I came up with a similar concept for in-editor SSR as an extension to existing find/replace functionality: https://codepatterns.io/
It worked great for the use case I built it around initially but I think it would need a scripting/logic component to generalise to any conceivable refactoring.