If I jack-in and close the editor, my process stays alive (server remains up). I added a shutdown hook, didn't help. If I jack-in but manually kill the process from the Calva Jack-in terminal, it shuts down correctly. If I manually do the steps instead of jacking in then close the editor, it shuts down correctly. Any ideas? š
The jack-in process is managed by Calva. My guess is that VS Code doesnāt give Calva a chance to kill it. What OS are you on? Iām in Mac and seldom see this problem. I know we have some special code for Windows for killing the process. But the shell environment there is pretty crazy.
@mithrandir03 Does "jack-in" mean "start a repl and jack in"? And comparing "jack-in" with "manually do the steps instead of jacking in", what are those steps?
From the description I am guessing that āmanually do the steps instead of jacking inā means starting the repl from the command line, and in a VS Code terminal, since the process is killed when VS Code is closed.
Hey, guys.
It's on a Mac. It happens every time on this project for me.
It is "start a repl and jack-in", with a custom connect sequence (I should test without the custom sequence!).
@pez is right about the manual steps. It's starting from the VS Code terminal with npx shadow-cljs -d cider/cider-nrepl:0.52.1 run dev/start-dev! then "Connect to a running REPL server".
How does the Calva test runner work? I've done some alter-var-root changes to clojure.test, which I can confirm take effect in the repl, but when I ask Calva to run the tests, my changes don't take effect. Are they run in a separate environment somehow?
Thanks! Iāll dig some more into this.
There is a concept of nrepl sessions. They have different dynamic environments. So *ns* and such. But I the test runner runs in the same session anyway, so it couldnāt be that⦠Maybe ask in #nrepl if someone has an idea how this works.
Does anything exist that lets me search by form structure? For example, say I wanted to find places where (this is a re-frame related example) I had registered a subscription with a signal function. Most of my subscriptions are set up like this:
(rf/reg-sub
::my-sub
(fn [...] ...))
but if I used a signal function it would look like this:
(rf/reg-sub
::another-sub
(fn [...] ...)
(fn [...] ...))
I would love a way to search for that pattern of forms, something like (rf/reg-sub * (*) (*)). I know I could probably figure out some hairy regular expression that might get me there, but it would really be nice to have the search "know" about forms and let me search using a pattern based on the form structure.Just in case anyone was really worried about me, I did use this pattern and found uses of signal functions,
rf/reg-sub\n ::.*\n \(.*\n \(
which I then marked with a ;; signal-fn comment so I can find them again later.
So the regex wasn't all that bad.
But still, I think it would be handy to have a form-aware search capability.We do searches like this in Calva, such as when figuring out the current ns. These searches are not across the codebase, but anyway, they need to be structural and canāt be transformed to a sweet regex like yours there. My brain hurts a little trying to figure out what facility would allow this in user space, but maybe exposing more of Calva structural editor to #joyride would make it possible to create custom searches with a bit of Clojure code in user space...