Fork me on GitHub
bringe00:01:31 This may help you, but may not be exactly what you want.


If you're saying you want to start a clojure cli repl, and also a shadow-cljs repl, separately, and have calva switch between them, there's no real easy way that I know of, but you can start one via jack-in (if you want), and start another manually in a terminal, and run Calva's "connect to running repl" command to switch between them, providing the port.

🙌 3

I'm not sure if you could also start the shadow repl from the clojure-cli repl, but if so, it might be easier to switch between them. I haven't done much work like that, so someone else here may have another suggestion.

Aleksander Rendtslev00:01:27

Ok, I’ll try that. Another issue I’ve run into: None of my logs seem to print to the repl. Eg: (println "Hi there") prints to the repl when I run my server in emacs, but not when I do it in calva. It will print it, if I evaluate the function call. But it won’t if the function is called by an endpoint being triggered. I can fiddle a little more with it, but I just wanted to post it here in case it was anything obvious


I'm not sure which part of what I said you meant you will try, but I just realized this part of that doc actually looks like your scenario: - and may be easier than trying to switch in the same vs code window providing a port. With the way in the doc you can use jack-in for both too.

Aleksander Rendtslev00:01:31

But it would mean running to windows at all times, right?

Aleksander Rendtslev00:01:49

Great! This works. I have to start to windows, but I can connect to the repl in the other one

Aleksander Rendtslev00:01:54

that seems to make it work pretty decently


Glad to hear!


Hmm I'm not sure. By "repl" you mean Calva's output/repl window?


If it persists, please create an issue with repro steps.

Aleksander Rendtslev00:01:44

Arhh, they only show up in the jacked-in terminal. And not the output file


Not sure why the printing happens that way, or if we can make it print to the Calva output window when the function's hit via endpoint. Maybe @pez will have some insight here when he gets back on.


Calva version 2.0.155 is out! 🎉 calva clojure-lsp • Update clojure-lsp to 2021.01.28-03.03.16 • Fix: Thanks to @claudius.nicolae for the nrepl port race condition fix!

calva 6

@alexander.minolta, about the printing of things going on in the server. It’s the way the nrepl server is attached, it doesn’t get hold of stdout from some threads. Or, I shouldn’t speculate too much, @bozhidar might be better to explain this. But anyway, Calva prints nrepl connection doesn’t get hodl of it and thus does not print it. But all is not lost. For jack-in sessions we can relay the output of the jack-in process to the output window. I am guessing that is what CIDER does too, or can it print it there even for non-jack-in sessions… Again, hopefully we can get Bozhidar’s input on it. In any case, please file an issue about that you want that output in the repl window (if you still want it after having found where it prints). Sounds like it could be an opt-in thing, because I certainly have projects where I wouldn’t want that. Some servers are very chatty.

Alexander Kouznetsov07:01:33

Did you mean to tag @aleksander990?

❤️ 3

Just happened to notice this comment... I think this is the root cause: I think every editor that uses nREPL would benefit if that issue were resolved.


I'd certainly want it in mine.


I agree it is confusing the way it is now, but if it is fixed there, I hope the messages are made special so that the editor can choose to relay them specially. (Added that to the issue now).


Unfortunately, it's also pretty hard to get it right due to how Java output streams work, otherwise we would have fixed it by now. The closest we got to a solution was the output middleware in cider-nrepl that does some aggressive output rebindings, but because some users complained about this I was wary of using the same approach in nREPL.


If someone wants to take a closer look and suggest different approaches - be my guest.

clyfe09:01:37 This really irks me, and what's worse I can't achieve it easily from outside Calva.


Emacs does the same


There are several ways to do it. Expand selection, then delete, is one. Or use alt+backspace/`alt+delete` .


The goal is have backspace do it for me. Based on context.


"ab(|)cd" + backspace = "ab|cd" ; (editing in strings) is this a bug?


No, it’s by design. But we are considering if we should be make it a bit more of a special case than we do today.


We probably should treat it in a more special case way. I can fix this easily, I think.


It can do damage too: "let me edit my financial message string: replace this '(' meaning sale, with 'x' meaning refund: backspace, x" boom we broke the bank!


This would easily go unnoticed.


This is hammock time stuff that is not ready to be implemented.


Hello! Can I disable that horrible clojure-lsp?

😔 3

What troubles you about it?


It starts authomatically on every VSCode instance with Clojure project I opened, even if it is a cljs project and I'm not going to start a REPL, takes a lot of time on my machine and can freeze it at all on next VSCode instance open.


I think this is a reasonable complaint which can probably be addressed by the Calva and/or Clojure-LSP team. It's just the way you said it, which doesn't make it come across effectively ;)


Here's a "right now" trick: rename ~/.vscode/extensions/betterthantomorrow.calva-2.0.155/clojure-lsp.jar with an underscore in front. Won't be able to start anymore. An error will be printed in the output, but otherwise things will work.

👍 3

Thanks alot, I'l try this hack 🙂


BTW, are you using which version of calva? The latest one uses improved versions of clojure-lsp that should not be a issue for users, otherwise it'd be great what's the performance issue


Ugh, removing of the clojure-lsp jar is bad advice. It might or might not work depending on what you do. The reason clojure-lsp can’t be disabled is that we don’t have the time to maintain Calva if we need to consider all-over if clojure-lsp is enabled or not.


Also: > even if it is a cljs project and I’m not going to start a REPL Two things: 1. One of the major reasons clojure-lsp is added is because it makes a lot of Calva features available without the REPL. 2. cljs and REPL are not mutually exclusive.

☝️ 3

VSCode Version: 1.52.1 Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523 Date: 2020-12-16T16:32:10.090Z Electron: 9.3.5 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: OS: Linux x64 5.4.0-62-generic Calva v2.0.155


I'm not a native speaker and maybe dont know about outside of dictionaries accents of some english words. But "Better Than Tomorrow" sounds contraversaly ) I remember good old days when I switched to Calva from Emacs and it was like a holiday ) But later cames gui-repl with bugs and without ability to return to good terminal-based. Now it's a third repl, better than that gui but worse than first terminal-like. And newcoming lsp. I renamed file and disabled it, for the first look there are no freezes but I had no time to check all. I understand the reasons of lsp and calva. But on my long calva usage I'm afraid, that every time moment I can say, that current state of things is "Better Than Tomorrow" (((. I dont want to switch back to Emacs, I like VSCode and fact that Calva is free, but maybe keep it as it is, for preventing fact, that yesterdays one was better?


You can install older versions.


Sounds interesting, dont know how they will work wih updated fresh VSCode, but, thanks, I'l try to get and install old Calva


If you want something more basic, there are also alternatives to Calva, like Clover (which is for REPL over a socket) or another one which is nREPL only.


You can then install the clj-kondo plugin optionally aside from that, if you want linting, or not.


I dont need a lot - I can start repl manually in side terminal, only what I need from plugin - just hotkeys for 3-4 operations - load file, eval expression and maybe that's all


Then maybe Clover is a good fit for what you want.

👍 3

Thanks, I'l check Clover.


There is also a #chlorine channel which is the same plugin, but for Atom. They share basically the same code.


Maybe it was true for you then, @ivana, that yesterday’s Calva was better than tomorrow’s. 😃

😂 3

@ivana no, you can’t. And I think you are being rude. People have been working super hard with creating and improving clojure-lsp.

borkdude15:01:32 (unrelated to prior discussion which I didn't read yet, until now)

metal 6

Apropos the discourse on open source community etiquette, I think this is the best piece ever, by margins:

Tzafrir Ben Ami18:01:38

is there a way in config to disable the lsp server?

Tzafrir Ben Ami18:01:12

10x, my Mac CPU is staying in 100% for hours until reboot due to some Java process related to LSP server. Disabling for now


Are you on latest Calva?


Note my proposed little trick there (rename jar) may have buggy consequences.

Tzafrir Ben Ami18:01:21

version v2.0.155 with Java Corretto-


Is that the latest calva @pez?


yes; lsp process also goes up to 2gb on first project run


on mostly empty project


That is the latest Calva. Do we know if there are performance issues with the latest versus previous couple of versions?


clojure-lsp has a xmx of 2GB, lowering that may affect users with huge projects, not sure the best way to handle that


we already made a lot of improvements like use just clj-kondo to analysis and batch analysis classpath which reduced a lot the memory usage last week release, more info here:


It works nicely when I open projects. And it starts much faster than it used to. Haven’t noticed much CPU or RAM usage either, but I have a pretty decent machine so maybe not the best test subject for the issue.Still, I’m thinking it could be specific to certain platforms.


Also, what probably is much worse than some temporary heatage is the reported freezing of the UI. Which sounds like a Calva issue to me, rather than a clojure-lsp one.


Here we have one local mem "works on my machine" as a developers answer on customers issue. Do you have such mem in Sweden? 🙂

😶 3

Yes, we have that saying here as well.


Could be an issue with specific OS's or specific JDK versions. That could be hard to track down, but we can start here:

👍 3

I put it in the Calva repo because we don't know for sure if it's not specific to Calva (at least some symptoms), and because Calva users may find it more easily


Re: recent "remove lsp" I think I'm seeing "extra fan hurling" on my antique laptop; only on first run though, it's fast after (probably cache build).


The annoying part is it freezes the UI so maybe we can non-block the call?


Issue, please, it there isn't one already.


And if you can figure out at which Calva version it started to happen: golden stars in heaven for you (as we say in Sweden).

😂 3

Can't reproduce at all the earlier freeze, but I'm seeing lsp process go up to 2GB on a mostly empty shadow-cljs project.