Skip to content

Support jump-to-definition #1764

@byorgey

Description

@byorgey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-Moderate EffortShould take a moderate amount of time to address.L-Language ServerIssues relating to the LSP implementation that talks to editors.S-Nice to haveThe bug fix or feature would be nice but doesn't currently have much negative impact.Z-FeatureA new feature to be added to the game.Z-User ExperienceThis issue seeks to make the game more enjoyable to play.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions