Skip to content

Add definitionStyle option to control multi-head goto definition#39

Draft
flowerett wants to merge 1 commit intoremoteoss:mainfrom
flowerett:configure-goto-for-multiple-function-definitions
Draft

Add definitionStyle option to control multi-head goto definition#39
flowerett wants to merge 1 commit intoremoteoss:mainfrom
flowerett:configure-goto-for-multiple-function-definitions

Conversation

@flowerett
Copy link
Copy Markdown
Contributor

@flowerett flowerett commented Apr 16, 2026

Solves this issue

When a function has multiple heads/clauses, editors like Zed show a picker UI instead of jumping directly.

The new "definitionStyle" initializationOption ("all" or "first") lets users choose whether to return all definition sites or just the first one.

the new initializationOption will look like:

"dexter": {
      "initialization_options": {
        ...
        "definitionStyle": "first" # or "all"
      }
}

  When a function has multiple heads/clauses, editors like Zed show a picker UI instead of jumping directly.
  The new "definitionStyle" initializationOption ("all" or "first") lets users choose whether to return all definition sites or just the first one.
@flowerett flowerett self-assigned this Apr 16, 2026
@flowerett
Copy link
Copy Markdown
Contributor Author

@JesseHerrick would be great to know your thoughts about this approach and naming.

@flowerett flowerett requested a review from JesseHerrick April 16, 2026 09:24
@JesseHerrick
Copy link
Copy Markdown
Collaborator

Hey @flowerett, thanks for the PR! This same thing happens with all editors and LSPs when there are multiple function heads for the same definition with the same arity. IMO that is a feature. While it's something we could change in the LSP, this is something I'd actually leave up to the LSP client and editor to configure to their liking. Editors should be able to just say "give me the first option" instead of opening the list if they want it. In NeoVim this isn't too tricky to configure, but maybe in Zed it's a pain. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants