Ask HN: Why are there no powerful free refactoring libraries for text editors?
But why are there no free alternatives for refactoring? Is there some difficult technical problem?
If we consider, for example, Java and refactoring then Rename Variable, Extract Method and similar features do not look very hard to implement. There are libraries for parsing Java and if we have the syntax tree then it's just a matter of performing the modifications on it.
Parsing broken code may be a challenge, but a powerful refactoring library would be very helpful even if it could work only on compilable code. Text editors could just call the library and reload the source files after the refactoring is done.
LSP is a step in the good direction by providing completion, jump to definition, etc. Why are there no similar libraries for source code refactorings? What is the difficulty here?
7 comments
[ 4.9 ms ] story [ 30.4 ms ] threadIf Emacs has access to a refactoring library and completions via LSP then it could have the strength of Emacs combined with the strong language support of IDEs. I'm saying this as a long time Emacs user who also used Android Studio a lot for Java programming, so I can appreciate the fortes of both sides of the fence.
I’d look into a strong type system like Haskell, F#, shoot even Rust will help in large refactorings being easier