What is the difference between Goto Declaration and Goto Definition in the Language Server Protocol?
Goto Definition: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition
Goto Declaration: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration
Should a language server implement both or only one?
(Sorry about cross-posting to #t-compiler/help, I didn't know where to ask.)
After looking at the rust-analyzer source, it seems only Goto definition is implemented. Is Goto Declaration an older name kept for backwards compatibility?
It's really used in languages that need the distinction between declaration and well... definition. For instance in C++ you can have a variable declared somewhere (ex a header) and defined somewhere else (cpp)
Ok, that makes sense. Thanks.
We don't use it in
If you have questions about the LSP protocol itself the best place is: https://github.com/microsoft/language-server-protocol
If I have questions about language server implementation is it ok if I ask here? I am using Rust for mine (+ similar dependencies), but it's for a different target language.
I can answer some questions
Good point! I forgot about that issue.