Fork me on GitHub

last few weeks have been calva with node shadow-cljs project, aimed at an embedded device. trying to get the knack of how to exploit the tooling. It is kind of a weird setup, since I need to run the app (outside vscode) from the command line, and on the embedded device. So I'm doing a shadow-cljs release, then pushing to the device, then a shadow compile, and running locally, all the while wanting a quasi-hot repl in calva. shadow-cljs has it's server, which makes all of this work pretty well, except calva gets all tangled up in it, guessing because it is wanting to get shadow to start it on jack in. Not wholly unsucessful doing a calva-connect to a running shadow repl, but I lose tooltips, jump to source, etc. via that attack. Wondering if reasonable to ask calva to admit an already running shadow server into the fray, at which point, this would all be golden


the downside of counting on calva to support the server, is, well, node-js, where sometimes it's just better to toss the runtime and start over. As it is, that means another jack-in, equating to another JVM warmup for the shadow server.


I think I will need a drawing that shows the pieces and how they are hooked up to each other, @hoppy


Anyone has experience with tmLanguage grammars? Calva has this strange issue with syntax highlighting breaking when tokens are at the start of a line. It is rare for Clojure code to expose the error, but it is there and annoys me. What annoys me the most is that i am clueless on how to fix it. I started out thinking it would be easy but got stuck when I realized I don't even know how to write the tests for it. There seems to be no concept of lines in the grammar so this error should not exists. 😃 Here are the relevant files for someone wanting to assist with this mystery: • The specs: • The grammar: • How to hack on the grammar: • The issue:


I can also recommend the VS Code command Developer: Inspect editor tokens and scopes


Actually, now I think I know how to fix it. 🎉 However, still don't know how to test for it. We'll see if that clears up.

duckie 3

it's amazing how much clearer things can be when there are less backslashes


Haha, yeah, cson is nice, but the backslashtitis!


Here's a draft PR that includes this fix- Now need to figure on how to include the changes in the specs...


And I think I have fixed such that you shouldn't need to include the generated json in the commit. Or I should fix it if not. 😃


This one is much tricker though. Might not even be possible.


It's almost hilarious that the grammar doesn't include list 😃


I shouldn't say it's impossible to fix issue 836, but I fail so far, every way I try.


yeah, i kept scanning for list and then realized it was probably named something else. it is the one for s-expression right?


Yeah, sexpr. I guess that's totally valid. I find it annoying that I can't figure out how to express ”the first symbol in a list”. And also that I can't figure out how to test for ”beginning of line”. But at least I can express it, maybe I will have to be fine with that.


@pez, I will look at some calva source and educate myself a bit / try some things. If I find anything out, I'll make a ticket and/or pr


It seems like starting the shadow server ahead of time, and using "calva: connect to nrepl server in project" gives pretty much all the flexibility needed here. The only caveat is that it seems like the function definitions data is missing/not used (hover, got to definition, etc). Any reason why this would be expected?


How are you starting the shadow server?


npx shadow-cljs start


You need to supply the nrepl dependencies. I'm afk, but if you jack in you'll see what needs to be on the command line.


You can add them to the he project as well, but I recommend injecting from the command line.


works perfectly, thanks.

calva 3