Fork me on GitHub
#calva
<
2022-10-17
>
Kari Marttila18:10:56

I was experimenting running both clj nrepl and cljs nrepl in the same VSCode/Calva instance. Some observations. • Basically, it is working fine. Both repls send evaluations to the output.calva-repl file. Whether this is a good thing or not, I'm not yet quite sure. In IntelliJ/Cursive you have dedicated repl output windows for different repls. I guess, I would like that more. • You can see at the bottom of the VSCode window the status bar, which says "REPL clj" (if your focus is in a clj file) or "REPL cljs" (if your focus is in a cljs file). However, if you hover mouse over the REPL icon, Calva tells that you are connected to the same port in both clj nrepl and cljs nrepl (I guess the one which was the last one started). A minor bug, I guess?

Kari Marttila18:10:10

Regarding having both Clojure nrepl and Clojurescript nrepl connected into your editor: I like Calva more. In Cursive if you switch from clj/cljs files, you have to manually remember to click the right repl output window for the evaluation to work (i.e., you cannot evaluate Clojurescript code in a Clojure repl). Calva seems to identify automatically which file you have and use the right nrepl server.

pez18:10:40

Thanks for this feedback. I think we can consider if it should be separate windows or not. A thing with Calva is that we try to not create too many options, as that adds cognitive load for the user and maintenance burdens for us. I think we have such a case here, where it would be either two or one. And if we decide two, someone who really wants that will have to have time to do change it. It's a bit of a hairball with this code, so it'll be some work.

Kari Marttila18:10:18

Yep. Not a show-stopper for me that both repls echo to the same file. But it could be an option that you could use different output files for different repls.

pez18:10:43

There is only one REPL port for this setup, btw. The ClojureScript REPL session is created from a clone of the Clojure REPL session. This video tries to educate around how this works: https://www.youtube.com/watch?v=islMjv55cN8 Or, if you prefer read instead/as well, here's a blog article I wrote on the subject. https://blog.agical.se/en/posts/shadow-cljs-clojure-cljurescript-calva-nrepl-basics/

pez18:10:28

> But it could be an option that you could use different output files for different repls. If you re-read what I wrote you will see that this will probably not be something we make optional. 😃

Kari Marttila18:10:30

Ok. No problem. 🙂

pez18:10:59

I don't know if you have tried with CLJC files, yet, @U76D9RZRR. With those the statusbar icon shows ”REPL cljc/clj” if Calva is connected to the Clojure REPL, and ”REPL cljc/cljs” with a ClojureScript REPL. And, the ”cljc/clj(s)" item turns into a button that toggles the REPL connection between the two sessions.

pez18:10:57

In fact, the REPL/Output window is treated as a CLJC file when there are both Clojure and ClojureScript REPLs connected. If you are the type of Clojurian who type at the prompt (are you?), this is good to know.

Kari Marttila18:10:37

Nope. I never type in the prompt. 🙂 I watched Stuart Halloway's video about that.

Kari Marttila18:10:17

Yep, I noticed that it has this notification for cljc files. Nice.

Kari Marttila18:10:43

I'll watch the that video you linked after my precious sauna experience that I never miss. Not a single day. 🙂

pez19:10:46

Haha, sauna, of course. :flag-fi:

alekszelark19:10:08

Hi! Looks weird that slurp/barf forward commands add an extra line within a comment. 2.0.307

pez20:10:37

Thanks! Please report it as an issue. It's our special RCF formatting that trips the Paredit operation up. https://calva.io/rich-comments/#special-formatting Not sure how easy to fix, but an issue is a good start. 🙏