Fork me on GitHub
#calva
<
2020-10-31
>
hoppy00:10:15

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

hoppy00:10:45

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.

pez10:10:17

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

pez12:10:54

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: https://github.com/BetterThanTomorrow/calva/blob/master/src/calva-fmt/atom-language-clojure/spec/clojure-spec.coffee • The grammar: https://github.com/BetterThanTomorrow/calva/blob/master/src/calva-fmt/atom-language-clojure/grammars/clojure.cson • How to hack on the grammar: https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva#updating-the-tmlanguge-grammar • The issue: https://github.com/BetterThanTomorrow/calva/issues/835

pez12:10:42

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

pez12:10:07

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
sogaiu12:10:33

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

pez13:10:46

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

pez13:10:50

Here's a draft PR that includes this fix- Now need to figure on how to include the changes in the specs... https://github.com/BetterThanTomorrow/calva/pull/837

pez13:10:43

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. 😃

pez13:10:34

This one is much tricker though. https://github.com/BetterThanTomorrow/calva/issues/836 Might not even be possible.

pez13:10:26

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

pez17:10:10

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

sogaiu00:11:36

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

pez08:11:01

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.

hoppy13:10:49

@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

hoppy14:10:53

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?

pez14:10:27

How are you starting the shadow server?

hoppy14:10:21

npx shadow-cljs start

pez14:10:12

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.

pez14:10:17

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

hoppy16:10:21

works perfectly, thanks.

calva 3