-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to exclude the definition from references in LSP searches #5344
Comments
It's possible to configure this in the LSP references request: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#referenceContext. Currently we hard-code this to
That is how goto-references should behave if the language server only sends one location: helix/helix-term/src/commands/lsp.rs Lines 878 to 880 in 63dcaae
|
I wanted to send a PR for this but didn't get around to this yet. Was it a concious choice to hardcode true here? It seems like |
The descision/code predates me (#8) but the |
I'm cool with this being the default if most folks find that useful and/or consistent with their expectations. I'd just like to be able to exclude it in a cfg opt and jump straight to a sole reference other than the def as well. |
I'd say a good default behaviour is listing the definition reference at the bottom of the list, which seems to already be how it behaves for Rust. |
…elix-editor#6886) * feat: added the config option to exclude declaration from reference query Fixes: helix-editor#5344 * fix: review * fix: review
…elix-editor#6886) * feat: added the config option to exclude declaration from reference query Fixes: helix-editor#5344 * fix: review * fix: review
…elix-editor#6886) * feat: added the config option to exclude declaration from reference query Fixes: helix-editor#5344 * fix: review * fix: review
The first ref search result is actually definition that I started the search from:
As far as I'm concerned, it should not be listed at all. Relatedly, It would be cool if a jump happened straight to reference if only one exists, with the search window never appearing.
The text was updated successfully, but these errors were encountered: