helix
helix copied to clipboard
Remove duplicates from the picker
Trying to find references for example in goto_reference in commands.rs brings up a lot of duplicate matches. This change removes the duplicates from lsp goto_* commands.
Before:

After:

How can I preview multiple references to the same symbol in a specific file with these changes? I often use go_to_reference to check usage of specific method/function, I wonder how can I do that without having all the individual references from single file in the picker.
That works, even if the same symbol is on the same line multiple times, because the position returned from lsp is different for them.
For example line Some(highlights) if !highlights.is_empty() => highlights, will be listed three times if i make goto_reference on highlights.
How can I preview multiple references to the same symbol in a specific file with these changes?
This behavior is unchanged. It's only merging completely identical references: same range of characters in the same file. Separate references in the same file will continue working like normal
Personally, I think the duplicates should be fixed on the language server side, instead of working around this in helix.
Ah I didn't know someone else had a PR in progress.
Personally, I think the duplicates should be fixed on the language server side, instead of working around this in helix.
:eyes: at rust-analyzer's 1000+ open issues
Ideally, yes. But a workaround like this or #4252 would be appreciated in the meantime.
I think we can close this now since RA merged an upstream fix for this last year: https://github.com/rust-lang/rust-analyzer/pull/13571