Things that LSP can do
I found myself wondering today what features the Language Server Protocol (LSP) supports natively. PyCharm supports a few navigations/searches and refactors that I value. I'm curious if I can get the same effect using Emacs for C/C++ with a language server, rather than using VSCode, CLion, or XCode.
Some examples of PyCharm features I use:
- Completion.
- Go to definition.
- Go to usage.
- Show all usages.
- Go to superclass/subclass.
- Show method signature/parameters and documentation.
- Rename variable/method/class/etc. at point.
- Sometimes: Inline variable/method.
- Sometimes: Extract method.
- Rarely, but very useful when I do: Move variable/method/class/etc.
Here's what's in and out of the language server specification:
- Completion, of course.
- Go to definition/declaration.
- NOT: Go to usage. (Presumably the next feature would let you do it in the editor?)
- Show all usages via find all references and prepare call hierarchy request.
- Go to superclass/subclass maybe via prepare type hierarchy request.
- Show method signature/parameters and documentation via the same request, I think.
- Rename thing at point.
- NOT: Inline variable/method. Maybe doable using Monikers? Not easy though.
- NOT: Extract method. I don't see a way to do this.
- NOT: Move. As far as I can see, anyway. Maybe Monikers help?
From a quick search I don't see an easy way of doing 8 through 10 — but that doesn't mean there isn't one.