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`.
Janne Sauvala 2020-12-04T07:25:32.043800Z

Hi Pez, I liked your “ClojureScript loves React Native” video on YouTube! Your vscode setup looked neat, what theme were you using?

pez 2020-12-04T07:31:25.045500Z

I’m using GitHub Dark. It’s not perfect (themes never are, right? 😃 ) but it is the nicest one I’ve found. I think it might be as complete, or maybe even more complete, than the default dark one.

Janne Sauvala 2020-12-04T10:26:22.045700Z

Thanks! That is true that themes are never perfect. I find myself changing those frequently when I got tired on my current one 🙂 I’ll try this one next

pez 2020-12-04T11:01:22.045900Z

I think it is more complete than the default one, because it shows me bugs in Calva’s syntax highlight that I wasn’t aware of. 😃

Janne Sauvala 2020-12-04T10:26:22.045700Z

Thanks! That is true that themes are never perfect. I find myself changing those frequently when I got tired on my current one 🙂 I’ll try this one next

pez 2020-12-04T11:01:22.045900Z

I think it is more complete than the default one, because it shows me bugs in Calva’s syntax highlight that I wasn’t aware of. 😃

Stefan 2020-12-04T11:10:26.047Z

I’m feeling more lazy than adventurous today, so I’m wondering if somebody else has already gotten Vlaaad’s Reveal working with Calva and Leiningen? I’m pretty sure it should be possible…. somehow…

pez 2020-12-04T11:16:02.048300Z

I listened to the #defnpodcast with @vlaaad the other night. Got me super curious about trying Reveal out with Calva. Would love if someone added how to set it up to http://calva.io.

Stefan 2020-12-04T11:28:55.048500Z

Indeed me as well 🙂

vlaaad 2020-12-04T14:19:29.048600Z

You can just use reveal nrepl middleware

Stefan 2020-12-06T13:45:32.143700Z

Ok I got it working. @pez I put this in my Leiningen project.clj:

:profiles {:reveal {:dependencies [[vlaaad/reveal "1.1.164"]]
                    :repl-options {:nrepl-middleware [vlaaad.reveal.nrepl/middleware]}}}
With that, normal jack-in (using this profile) should launch Reveal as well.

pez 2020-12-06T14:03:53.145300Z

Awesome. Can i hope for a PR adding that info to http://calva.io? 😍

Stefan 2020-12-06T14:04:27.145500Z

Beat you to it 😝

Stefan 2020-12-06T14:04:53.145700Z

If you’re going to try this out using a tools.deps project, could you maybe add that to the doc page?

pez 2020-12-06T15:26:47.145900Z

Oh, didn’t see the PR. Very cool. I suggested you add something about PR welcome to the deps section.

Stefan 2020-12-04T14:50:24.048900Z

Yeah I read that, but I couldn’t find vlaaad.reveal.nrepl/middleware on Clojars so I’m not sure about the version number. And I also seem to run into the JavaFX thing where I apparently have a JDK8 without JavaFX, but that shouldn’t be too difficult to fix I guess.

vlaaad 2020-12-04T15:39:11.049100Z

This middleware is a part of default Reveal distribution, not a separate artifact. Having Reveal on the classpath is enough to use this middleware

Stefan 2020-12-04T15:43:34.049400Z

Ok so I just add reveal as a dependency and use that middleware. I’ll try, thanks!

vlaaad 2020-12-04T15:44:27.049700Z

Exactly! No problem 👍

bringe 2020-12-04T20:30:20.057300Z

Has anyone here had an issue with not being able to get env vars from Calva's repl? If I run clj -r I can call (System/getenv "MY_VAR") and see the value, but if I run that same line in Calva's repl (created by jackin), it returns nil

bringe 2020-12-04T20:34:54.058700Z

Interesting.... it has something to do with cider-nrepl or its middleware. If I take the jackin command and modify it to remove cider-nrepl, then it works :thinking_face:

clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"}}}' -A:dev -m nrepl.cmdline

bringe 2020-12-04T20:41:03.059500Z

Ok, if I remove just the cider-nrepl middleware it works..

bringe 2020-12-04T20:47:16.060400Z

@pez Any idea here? I've set the env vars in ~/.bashrc, have restarted my shell/vscode/my computer. I wonder if I need to set them elsewhere.

bringe 2020-12-05T17:23:38.137300Z

Do you think this has something to do with how Calva is starting the repl? For example, I can start vs code by clicking the shortcut, without using the terminal, and copy/paste the jack-in command into the integrated terminal, then connect calva to it, and it works.

bringe 2020-12-05T17:24:00.137500Z

It only doesn't work with the above start method when Calva issues the jack-in command itself

bringe 2020-12-05T17:25:38.137700Z

What I'm saying is, maybe there's another way to run the jackin task that would give access to the terminal env vars? I wonder if this PR could fix it - https://github.com/BetterThanTomorrow/calva/pull/654

pez 2020-12-05T19:30:54.138Z

We really should finish that WIP PR. Unfortunately it can’t fix this issue. Whatever process we start from VS Code, it can’t inherit an environment that VS Code does not have.

1👍
bringe 2020-12-05T20:04:50.138300Z

https://calva.io/connect/#environment-variables-are-not-readable-from-repl Now it's documented 🎉

pez 2020-12-05T20:07:02.138600Z

That’s so good. I can imagine how this is biting a lot of people.

bringe 2020-12-04T20:53:12.060600Z

Update: If I copy the jackin command and paste it in a terminal and start the repl that way, with an unmodified jackin command, and then connect to it manually, I can get the env vars. Using the vs code jackin command directly though, I cannot. I wonder what about the jackin process is different that makes my shell's added env vars inaccessible.

Mitch 2020-12-04T21:05:28.062800Z

Is the clojure-lsp branch close to being merged in? Very excited for that feature 🙂

2
pez 2020-12-04T21:13:16.062900Z

Is your code started from the shell?

pez 2020-12-04T21:19:21.067700Z

It’s quite a bit from being merged, @mitchell_clojure. But it is often quite useable for the non-picky user. 😃 You can help test it as we move along, Via VSIX of via running Calva in dev mode from the branch. If via VSIX: There is a VSIX built every time the branch is updated, If you are logged in on CircleCI, you should be able to pick the VSIX up from the links at the PR.

pez 2020-12-04T21:19:46.067800Z

Your VS Code, that is. 😃

Mitch 2020-12-04T21:21:27.068300Z

ooh might have to give it a go. Are those instructions somewhere I should have seen?

bringe 2020-12-04T21:35:13.068400Z

That fixed it -_-. I had seen people have this issue before but forgot, because it hadn't happened to me yet 😄

bringe 2020-12-04T21:39:54.071400Z

@mitchell_clojure See here: https://github.com/BetterThanTomorrow/calva/wiki/Testing-VSIX-Packages I had typed out a message earlier about testing the vsix starting now, but I have a whole list of things that need to be tidied up before releasing. Things like duplicate hover content, Go To Definition showing two definitions because Calva is providing a definition via nrepl and then clojure-lsp is providing a definition - this results in a peek window opening because vs code thinks it's two definitions (each provides a different location, one next to symbol and one next to def).

bringe 2020-12-04T21:40:11.071800Z

There are other things as well but it's a lot to type, which is why I stopped earlier and was going to wait

bringe 2020-12-04T21:41:00.072900Z

But feel free to test and make sure nothing crazy is happening. A lot of these things are easy to fix, and I'll be doing so in the coming weeks.

pez 2020-12-04T21:41:19.073300Z

That’s why I said “non picky” user. 😃

bringe 2020-12-04T21:41:40.074Z

Yeah, what I wanted to avoid is people testing and reporting all the things I know about, and then having to respond to each one lol

pez 2020-12-04T21:42:39.075Z

Maybe we can make the PR text show what to expect?

bringe 2020-12-04T21:43:13.076400Z

I thought about it, but it will be so easy to fix most things I don't know if it's worth the time to write them up before then

pez 2020-12-04T21:43:15.076500Z

A checklist of known issues, that when ticked of can be reported on, or some such.

bringe 2020-12-04T21:43:29.077Z

Once we release, if there are quirks then, I'd say that makes sense

bringe 2020-12-04T21:44:11.077400Z

Hm... I will think on it though

pez 2020-12-04T21:44:22.077800Z

Your call, @brandon.ringe, since you are driving this.

bringe 2020-12-04T21:45:03.078900Z

I guess it depends on how far out a release can happen. I think I may fix some of the easy things next week and then create the shorter list

pez 2020-12-04T21:46:19.080300Z

Anyway, for periods of times I have been running on the crude version I built when starting that PR. It is quite usable and the quirks do not overshadow the benefits from some of the nice things that cljoure-lsp brings.

bringe 2020-12-04T21:46:41.080600Z

Indeed, I've been using the latest PR version today

Mitch 2020-12-04T21:48:00.080900Z

Unsure. Related to this is that there is a "proof of concept" folder for VSCode integration in the clojure-lsp repo that is over a year old. It is definitely a red herring for other people like me who might be curious about progress

pez 2020-12-04T21:50:47.082300Z

This will certainly not be a smooth easy task for @brandon.ringe. But that is why it is good that he is the one doing it. 😃

pez 2020-12-04T21:52:16.083400Z

I think the PoC thing is not so relevant since @snoe’s focus is not VSCode. But our focus is.

bringe 2020-12-04T23:28:03.084200Z

Yeah, once we merge our client usage, we can submit a PR to update clojure-lsp's readme to point to Calva as a vs code client