-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Is your feature request related to a problem? Please describe.
I have emacs configured so that Alt-.
jumps to the definition of the name under the cursor. It would be cool if this worked in Swarm too.
Describe the solution you'd like
Specifically, I'd like the LSP server to support the textDocument/definition
capability, see https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textDocument_definition . A document position (= line number + character number) comes along with the request; we can use that to drill down into the AST to find the specific name being referenced (I think we already have that functionality implemented somewhere). The only slightly tricky part is that due to shadowing, the same textual name could be referring to different definitions depending on where it is in the AST. But I think we have already implemented something very similar to this when implementing unused variable warnings.