BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.67k stars 217 forks source link

Go to definition doesn't work with alternative definition command #1522

Open introom opened 2 years ago

introom commented 2 years ago

Suppose the cursor is already on the definition, the desired behavior when run go to definition would be going to the references, however calva stays at the definition.

image
bpringe commented 2 years ago

This is what happens when I run go to definition on a definition, which I believe is expected. Is this not what happens for you?

image

Cyrik commented 2 years ago

@introom I think it might also be different if you have a repl running or not. Have you tried both ways?

introom commented 2 years ago

To reproduce this problem

  1. The definiton and reference must be in different namespaces.
  2. Either: 2.a. Jack in repl and try find definition on the definition line. OR: do not jack in, but also do not open the reference file. then lsp won't be aware of the existence of the reference.
bpringe commented 2 years ago

I can reproduce this using a connected repl, and it doesn't seem to matter whether the reference is in the same namespace or not, no references are shown when Go to Definition is run on a definition. (2.a) @PEZ Should Calva show references in this case? It seems that ideally it should. I don't know what that would involve, yet.

The issue you mentioned with clojure-lsp did not occur for me. I even removed the .lsp directory and reloaded the window to restart clojure-lsp, and it still showed me the reference from the other file when I ran Go to Definition on the definition.