Fork me on GitHub
#calva
<
2022-07-29
>
Pratik04:07:55

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?

cmdrdats07:07:43

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

Pratik18:07:34

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?

Max17:08:15

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?

Pratik17:08:59

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.

Pratik12:08:13

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

pez12:08:34

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

Pratik12:08:56

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

pez12:08:06

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
pez12:08:03

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.

nikoe14:07:47

Hi noob here — is alt + enter the only way to trigger a repl? I’m following this https://www.youtube.com/watch?v=6uUynWkMDGM and when I use alt(option) + enter, nothing’s happening on my end

nikoe14:07:22

screenshot as reference

nikoe14:07:41

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

pez16:07:07

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
Stuart17:08:08

Yeah, in your screenshot your REPL is disconnected.

😅 2
1
nikoe21:08:51

@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