helix
helix copied to clipboard
Go to reference with gr gives repeated result.
Go to reference with gr gives repeated result.

Line number 226 looks like below

It's possible there are multiple references to whatever you're looking for with gr. We show the references the language server gives so this is most likely rust-analyzer returning multiple references on the same line. You can check the log when running in verbose mode to see exactly what rust-analyzer is saying: https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file
Without a reproduction case or log snippet though, there isn't really anything to go on here.
I've seen this with gopls where it's a bug on the language server side, it will sometimes return duplicates.
This could also be due to the macro expansion done by rust-analyzer internally. I've seen this myself with helix's codebase when gring any of the keybind commands (all the commands are bound to a parent struct through a big macro). Maybe an upstream issue exists?
Opened an issue upstream, in the meantime hx should do as VS Code does and dedupe refs in my opinion.
this was fixed upstream in https://github.com/rust-lang/rust-analyzer/pull/13571