Fork me on GitHub

Does Calva support any kind of debugging?


(any integration with VSCode debugger?)


Feels like it doesn't, just wanted to make sure.


(I'm looking for Cursive alternative)


Hey @pez 👋 1. Is it possible to replace calva-fmt with cljfmt? 2. Is it possible to replace joker with eastwood?


@slawek098 no debugging support in Calva. It is something i really would like to add, but the task is a bit too big for me.


@sasho.popov, not sure what you mean with the first question. About Joker, no. And also linting will be removed from Calva soon. There's a new linting extension in town, which you can ask @marc-omorain about.


Hey @pez , thanks for the answer. Regarding the first question - if I understand Calva correctly, when I format code it uses Is it possible to tell it to use


@sasho.popov, actually, that is only partially right. 😃 calva-fmt was an extension being bundled with the old Calva. Today it is integrated instead. Also, it is actually using cljfmt as its formatting engine.


Hm, but in that case I see something strange - a see a lot of code being underlines by Calva and a lot of formatting-related problems listed in the problems tab. However, when I run from the terminal lein cljfmt check/fix all is good.


That would be the linting that is underlining code. Formatting related problems in the problems tab sounds interesting. Can you give an example?


Hm, you are actually right, so what I’ll do is try to run joker from the command line and compare the problems, reported in the problems tab.


I find joker is allergic to ":refer all"


@pez that's unfortunate


hi everyone, is there a way to leverage vim in the calva repl?


@chadhs , no vimming in the calva repl.


kills fast repl driven dev for vimmers, but calva is amazing, and will definitely spread to all the vscode users i work with


Yes, it is very unfortunate. It is certainly possible to add vim mode, but it would be a lot of work. I think it would be better to create the repl window using the regular editors. (But I'm not sure how possible that is.)


but appreciate the response 🙂


Hey guys, had a small question. When I connect to my running shadow-cljs repl instance, my clj repl session (if already connected) is re-created/re-connected for the cljc files. Is there any way I can stop calva from re-creating my CLJ session?


@punit-naik is this on reconnect, or on the first connection?


It happens on the first connection.


What does it mean that the connection is recreated?


I mean if I connect to an already running external CLJ repl, and then if I try to connect to my already running external shadow cljs repl, it creates a new CLJS session and it over-writes/replaces the previously connected CLJ session. Now this is perfectly logical because the code has to spin up the new CLJ and CLJS sessions together because there might be some cljc files as well in the cljs project. But in my case I wanted the previously connected CLJ session to remain as the server side project that I am running shares code/dependencies with the shadow-cljs project. So for me it's okay if it does not recreate the CLJ session. I hope I explained myself properly.


I just checked in the code, at connector.ts#L20, it is closing all previously connected nrepl sessions before spinning up a new one:

if (nClient) {
        nClient["silent"] = true;
And it creates a fresh one at connector.ts#L30:
nClient = await NReplClient.create({ host: hostname, port: +port });
Please correct me if I am wrong in my understanding of the flow of the code.


So I was wondering if there was a way to check if there already exists an active clj nrepl session.


I am not sure I understand your setup correctly, not the question. But let me try to summarize the connection sequence. nClient there is an object keeping track of Calva's socket connection to the nrepl server. At connection time it can be the first connection and then nothing needs to be closed. Otherwise we clean away all sessions and stuff by closing the client connection (this fires a host of onClose event handlers). With the new socket connection we ask for a new nrepl session, then we clone that one and make it Calva's clj session. Then, if it is a CLJS project, we clone our clj session and make that our cljs session. We also make a clone of our clj session and assign that to the CLJ REPL window. And if it is a CLJS project we do the same with our cljs session for the CLJS REPL window.


We are never closing any other system's cljs connections or sessions. At least we shouldn't be doing that. That is what all this cloning is about.


Sending you a video on personal chat which explains this.