calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
hoppy 2020-10-31T00:11:15.045300Z

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

hoppy 2020-10-31T00:12:45.046500Z

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.

pez 2020-10-31T10:27:17.047300Z

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

pez 2020-10-31T12:13:54.053600Z

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

pez 2020-11-01T08:42:01.064600Z

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 2020-10-31T12:17:42.054200Z

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

pez 2020-10-31T12:46:07.054400Z

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.

1
2020-10-31T12:52:33.054700Z

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

pez 2020-10-31T13:05:46.054900Z

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

pez 2020-10-31T13:22:50.055100Z

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

pez 2020-10-31T13:28:43.055400Z

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

pez 2020-10-31T13:37:34.055600Z

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

pez 2020-10-31T13:40:26.055900Z

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

hoppy 2020-10-31T13:44:49.057Z

@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

hoppy 2020-10-31T14:10:53.059900Z

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?

pez 2020-10-31T14:12:27.060200Z

How are you starting the shadow server?

hoppy 2020-10-31T14:15:21.060400Z

npx shadow-cljs start

pez 2020-10-31T14:41:12.062200Z

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.

hoppy 2020-10-31T14:44:37.062400Z

ah nice

pez 2020-10-31T14:46:17.063600Z

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

hoppy 2020-10-31T16:55:21.063800Z

works perfectly, thanks.

1
pez 2020-10-31T17:14:10.064Z

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