Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All of these are doable with LSP. I'm a big fan of the "LSP rename" action which will rename a particular semantic item (e.g. a method) across files, or the refactoring actions (e.g. change an "if let" into a "match" in Rust).


Everything is doable with LSP as it is an extensible RPC essentially.

But the above things are not done in LSP generally. It doesn’t have first-class support for structural search replace. It doesn’t have support for interactive refactors which require user input.


Do you have an example of a language server capable of structural refactoring of the type mentioned in the GP? The “semantic rename” is table stakes from ~20 years ago in IntelliJ and ReSharper, and even Eclipse.


Rust Analyzer can do structural search and replace [0], though I've never used it nor IntelliJ's so I can't compare how capable both features are.

[0] https://rust-analyzer.github.io/manual.html#structural-searc...


Structural refactoring as in extract function/variable? You can find that in Rust Analyzer https://rust-analyzer.github.io/manual.html#assists-code-act...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: