Fork me on GitHub

When I connect to a running REPL(using port-forwarding) in my pods/VMs, Jump to definition stops working. If I am running a local REPL, it works fine, and without a REPL also it works fine. Anyone knows how to fix that?


we're seeing this too, it's a real pain


it doesn’t seem to be calva specific, for emacs also I see it happening, @U0ETXRFEW you happen to know why this happens or any way we can fix it?


My understanding was that this is because cider uses absolute paths to identify files, and the paths of the files in vscode and in the container are different. It works before you connect to a REPL because the language server (LSP) operates on relative paths. I vaguely remember that folks were talking about adding a setting to allow end-users to specify whether they wanted to use cider or LSP for go-to-definition, but I’m not sure if it landed or what it was called?


thanks, any workaround around this? I had to clone a repo and open it side by side last time I was trying to debug something inside REPL just to use go-to-definition.


@U0ETXRFEW bumping this again, in case you have any ideas


The setting that @U01EB0V3H39 recalls actually exists. calva.definitionProviderPriority. It doesn't really fix the issue, but could be a workaround.


so in my case, it’s repl, lsp . I’ll try changing it to lsp, repl and see if I can go to definition


There is also a less brute version of your cloning-the-repo workaround. You can create two VS Code workspaces and add the same project folder to both of them. Then open the workspaces in different windows.

👍 1

lsp lookups aren't very good with .cljc files. Since lsp is static, it can't know wether it's the Clojure or ClojureScript definition that should be used.


Hi noob here — is alt + enter the only way to trigger a repl? I’m following this and when I use alt(option) + enter, nothing’s happening on my end


screenshot as reference


nvm i got it to work by restarting it somehow..not sure what happened


Glad you got it working!

😊 1
Gabriel Kovacs16:07:47

alt + enter evaluates the (+ 1 1) it does not start the repl. Or at least this is my understanding :)

☝️ 1
💯 1

Yeah, in your screenshot your REPL is disconnected.

😅 2

@U02AMR8032L yup you were right haha -- I was not connected 😅. Also, I realized only after that the REPL needs to be run to refresh the function before you can call it and see the updated changes (it doesn’t do it automatically). Was changing “Hello World” to “poop,” and yet the REPL was still displaying “Hello World” to my dismay. 😤 Thanks @U013MQC5YKD for pointing me in the right direction/showing me how to go about REPL-driven development! So relieving to finally get it haha 🙂

clojure-spin 2