Fork me on GitHub
#calva
<
2021-01-28
>
bringe00:01:31

https://calva.io/workspace-layouts/ This may help you, but may not be exactly what you want.

bringe00:01:07

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
bringe00:01:43

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

bringe00:01:40

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: https://calva.io/workspace-layouts/#one-folder-two-windows - 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

bringe02:01:24

Glad to hear!

bringe00:01:07

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

bringe00:01:35

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

bringe02:01:14

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.

bringe04:01:22

Calva version 2.0.155 is out! 🎉 calva clojure-lsphttps://github.com/BetterThanTomorrow/calva/issues/989 • Update clojure-lsp to 2021.01.28-03.03.16 • Fix: https://github.com/BetterThanTomorrow/calva/issues/901 Thanks to @claudius.nicolae for the nrepl port race condition fix!

calva 6
pez07:01:23

@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
flowthing07:01:14

Just happened to notice this comment... I think this is the root cause: https://github.com/nrepl/nrepl/issues/119 I think every editor that uses nREPL would benefit if that issue were resolved.

flowthing07:01:58

I'd certainly want it in mine.

pez07:01:40

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

3
bozhidar09:01:00

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.

bozhidar09:01:19

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

clyfe09:01:37

https://github.com/BetterThanTomorrow/calva/issues/985 This really irks me, and what's worse I can't achieve it easily from outside Calva.

clyfe09:01:13

Emacs does the same

pez12:01:06

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

clyfe13:01:16

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

clyfe13:01:53

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

pez15:01:05

No, it’s by design. https://calva.io/paredit/#strings-are-not-lists-but-anyway But we are considering if we should be make it a bit more of a special case than we do today.

clyfe15:01:36

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

clyfe15:01:28

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!

clyfe15:01:32

This would easily go unnoticed.

pez17:01:43

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

ivana14:01:47

Hello! Can I disable that horrible clojure-lsp?

😔 3
clyfe15:01:28

What troubles you about it?

ivana15:01:41

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.

borkdude16:01:00

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

clyfe16:01:43

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
ivana16:01:41

Thanks alot, I'l try this hack 🙂

ericdallo16:01:41

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

pez16:01:40

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.

pez16:01:58

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
ivana16:01:12

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: 8.3.110.13-electron.0 OS: Linux x64 5.4.0-62-generic Calva v2.0.155

ivana16:01:50

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?

clyfe17:01:42

You can install older versions.

ivana17:01:30

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

borkdude17:01:32

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.

borkdude17:01:59

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

ivana17:01:12

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

borkdude17:01:35

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

👍 3
ivana17:01:57

Thanks, I'l check Clover.

borkdude17:01:58

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

pez17:01:08

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

😂 3
pez15:01:30

@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

https://twitter.com/pcalcado/status/1354813122742079491 (unrelated to prior discussion which I didn't read yet, until now)

metal 6
pez17:01:54

Apropos the discourse on open source community etiquette, I think this is the best piece ever, by margins: https://www.youtube.com/watch?v=GXgbV7jB_Bc

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

clyfe18:01:44

Are you on latest Calva?

clyfe18:01:03

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

Tzafrir Ben Ami18:01:21

version v2.0.155 with Java Corretto-15.0.1.9.1

ericdallo19:01:38

Is that the latest calva @pez?

clyfe19:01:44

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

clyfe19:01:02

on mostly empty project

bringe20:01:08

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

ericdallo20:01:34

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

ericdallo20:01:08

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: https://github.com/clojure-lsp/clojure-lsp/issues/268

pez21:01:11

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.

pez21:01:22

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.

ivana21:01:09

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
pez21:01:47

Yes, we have that saying here as well.

bringe22:01:45

Could be an issue with specific OS's or specific JDK versions. That could be hard to track down, but we can start here: https://github.com/BetterThanTomorrow/calva/issues/990

👍 3
bringe22:01:24

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

clyfe18:01:44

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

clyfe18:01:00

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

pez18:01:00

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

pez18:01:48

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
clyfe19:01:27

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.