haskell-language-server
haskell-language-server copied to clipboard
Add a handler for "Go To Declaration"
At the moment we mostly just use "go to definition", but LSP also has "go to declaration". I think the concept of a declaration does actually make sense in Haskell, namely:
- For entities that have a type/kind signature, go to declaration could go to the signature (which can be in a different location)
- For typeclass methods, go to declaration could go to the declaration in the class, and go to definition could go to the definitions in the instances
- Anything else?
"go to declaration" could navigate to relevant import statement for a non-local symbol; rarely used, but could be useful
typeclass-wise, there's also "go to implementation" request, which sounds semantically correct