this isn’t Cursive specific, I don’t believe, but I figure people here might know… is it just me, or are all the in-scope vars null
when walking up the stack in the IntelliJ debugger? they’re only populated in the bottom-most frame (i.e. directly on the breakpoint). I presume this is a side effect of how the Clojure runtime works, but just in case there’s any sort of optimization level that can be tweaked, that would make debugging a lot more pleasant.
actually, had a chance to try it out tonight, and yeah. this is going to be a game changer. have a nice rest of the weekend!
check out this article about locals clearing
https://cursive-ide.com/userguide/repl.html#starting-a-debug-repl
whoa, nice. that was easy! guess I just need to run this in the remote REPL just after attaching:
(alter-var-root #'clojure.core/*compiler-options*
update :disable-locals-clearing not)
er, actually, that’s too late… hmm
I basically need to find some way to run that before everything else gets loaded, I think
I thought you just restart the repl with that option set
well, I’m using a remote REPL in this case
Oh I see. Running it in docker or something?
uh… running lein repl
in Metabase 😆
Ah. Then just let cursive start it up. Not a remote connection then
that works some of the time, but not all (ex: driver loading)
Then I’m out of cursive knowledge at that point :)
yeah I think basically if you let Cursive launch it, then it must do this alter-var-root
invocation for you
I suspect there is some way to do it that Clojure just reads, i.e. https://clojure.atlassian.net/browse/CLJ-860
-Dclojure.compiler.disable-locals-clearing=true