helix icon indicating copy to clipboard operation
helix copied to clipboard

Go to reference with gr gives repeated result.

Open grv07 opened this issue 3 years ago • 4 comments

Go to reference with gr gives repeated result.

image

Line number 226 looks like below image

grv07 avatar Aug 08 '22 04:08 grv07

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.

the-mikedavis avatar Aug 08 '22 16:08 the-mikedavis

I've seen this with gopls where it's a bug on the language server side, it will sometimes return duplicates.

archseer avatar Aug 09 '22 02:08 archseer

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?

sudormrfbin avatar Aug 09 '22 04:08 sudormrfbin

Opened an issue upstream, in the meantime hx should do as VS Code does and dedupe refs in my opinion.

abseee avatar Oct 13 '22 09:10 abseee

this was fixed upstream in https://github.com/rust-lang/rust-analyzer/pull/13571

pascalkuthe avatar Jul 26 '23 13:07 pascalkuthe