Fork me on GitHub
#calva
<
2019-07-24
>
otwieracz07:07:46

Does Calva support any kind of debugging?

otwieracz07:07:56

(any integration with VSCode debugger?)

otwieracz07:07:27

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

otwieracz07:07:52

(I'm looking for Cursive alternative)

Sasho07:07:58

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

pez08:07:19

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

pez08:07:08

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

Sasho08:07:04

Hey @pez , thanks for the answer. Regarding the first question - if I understand Calva correctly, when I format code it uses https://github.com/BetterThanTomorrow/calva-fmt. Is it possible to tell it to use https://github.com/weavejester/cljfmt

pez08:07:30

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

Sasho08:07:09

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.

pez08:07:28

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

Sasho09:07:23

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.

hoppy05:07:54

I find joker is allergic to ":refer all"

otwieracz09:07:21

@pez that's unfortunate

chadhs15:07:19

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

pez15:07:00

@chadhs , no vimming in the calva repl.

chadhs15:07:25

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

pez17:07:32

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

chadhs15:07:21

but appreciate the response 🙂

punit-naik16:07:46

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?

pez17:07:57

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

punit-naik17:07:41

It happens on the first connection.

pez21:07:56

What does it mean that the connection is recreated?

punit-naik21:07:46

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.

punit-naik21:07:49

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;
        nClient.close();
}
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.

punit-naik21:07:23

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

pez09:07:02

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.

pez09:07:17

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.

punit-naik09:07:49

Sending you a video on personal chat which explains this.