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

nRepl code navigation not working in a project #1665

Open miguelperes opened 2 years ago

miguelperes commented 2 years ago

I'm having some issues with code navigation when connecting to a repl passing a specific port. As soon as I connect to the repl I can't jump to definition anymore. As soon as I disconnect from the repl and connect with the default port it starts working again.

Can we have the option to use only clojure-lsp features when jacked-in?

ericdallo commented 2 years ago

I already reported via Slack same need @bpringe @Cyrik @PEZ One more case regarding a setting for use clojure-lsp features instead of nrepl, WDYT?

PEZ commented 2 years ago

Yes, we agree and we think it is high priority. We're working on it along the lines of #1498.

That said. In this case the real issue is that jump to definition stops working when the REPL is connected. Sounds like something is misconfigured or that we have a bug in Calva. Can you give us some details around the project where this happens, @miguelperes ? A public repository exposing it would be the best, but just some more info would be nice as well.

PEZ commented 2 years ago

@miguelperes I'm refocusing this issue on the nrepl issue. If it is a bug we want to fix it. If it is some misconfiguration we want to help you fix it, and fix our documentation if we see how it can help better.

If, with working nrepl code navigation, you still see a need to configure clojure-lsp as primary provider of it, please add your support (thumbs up, additional rationale, etcetera) to this feature request/suggestion:

bpringe commented 2 years ago

@miguelperes Does the repl you're connecting to have cider-nrepl loaded as a dependency? If not, I don't think Go To Definition will work (via the repl). Calva's jack-in feature injects this dependency when it starts the repl.

There's a command for copying the jack-in command that would be used by jack-in, and using that to start your repl might solve your issue. Search the command palette for "copy jack-in command" to find the command.