calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
bringe 2021-01-28T00:16:31.258900Z

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

bringe 2021-01-28T00:19:07.261200Z

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.

🙌 1
bringe 2021-01-28T00:20:43.262700Z

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.

bringe 2021-01-28T00:20:57.262900Z

@aleksander990

Aleksander Rendtslev 2021-01-28T00:25:27.264800Z

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

bringe 2021-01-28T00:29:07.265200Z

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

bringe 2021-01-28T00:29:35.265800Z

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

bringe 2021-01-28T00:31:40.265900Z

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 Rendtslev 2021-01-28T00:42:31.266400Z

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

Aleksander Rendtslev 2021-01-28T00:46:44.266900Z

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

Aleksander Rendtslev 2021-01-28T00:48:49.267Z

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

Aleksander Rendtslev 2021-01-28T00:48:54.267200Z

that seems to make it work pretty decently

bringe 2021-01-28T02:13:24.267400Z

Glad to hear!

bringe 2021-01-28T02:16:14.269100Z

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.

bringe 2021-01-28T04:18:22.270300Z

Calva version 2.0.155 is out! 🎉 :calva: :clojure-lsp:https://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!

2
pez 2021-01-28T07:22:23.279600Z

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

bozhidar 2021-01-28T09:24:00.282600Z

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.

bozhidar 2021-01-28T09:24:19.282800Z

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

Alexander Kouznetsov 2021-01-28T07:24:33.279700Z

Did you mean to tag @aleksander990?

❤️ 1
flowthing 2021-01-28T07:37:14.280Z

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.

flowthing 2021-01-28T07:38:58.280300Z

I'd certainly want it in mine.

pez 2021-01-28T07:50:40.280600Z

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

1
clyfe 2021-01-28T09:14:37.282300Z

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

clyfe 2021-01-28T09:38:13.283300Z

Emacs does the same

pez 2021-01-28T12:49:06.285900Z

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

clyfe 2021-01-28T13:07:53.287100Z

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

clyfe 2021-01-28T13:09:16.287200Z

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

2021-01-28T14:50:47.288Z

Hello! Can I disable that horrible clojure-lsp?

😔 1
pez 2021-01-28T15:05:30.289600Z

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

pez 2021-01-28T15:07:05.289700Z

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.

alexmiller 2021-01-28T15:26:13.290500Z

maybe a good time to recall https://clojure.org/community/etiquette

clyfe 2021-01-28T15:27:36.290600Z

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

clyfe 2021-01-28T15:30:28.290800Z

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!

clyfe 2021-01-28T15:31:32.291100Z

This would easily go unnoticed.

clyfe 2021-01-28T15:37:28.291400Z

What troubles you about it?

borkdude 2021-01-28T15:42:32.291700Z

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

🤘 2
2021-01-28T15:54:41.292300Z

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.

borkdude 2021-01-28T16:07:00.292500Z

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

clyfe 2021-01-28T16:08:43.292700Z

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.

👍 1
2021-01-28T16:11:41.292900Z

Thanks alot, I'l try this hack 🙂

ericdallo 2021-01-28T16:34:41.293200Z

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

pez 2021-01-28T16:36:40.293400Z

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.

pez 2021-01-28T16:38:58.293600Z

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.

☝️ 1
2021-01-28T16:48:12.294Z

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

2021-01-28T16:57:50.294200Z

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?

clyfe 2021-01-28T17:01:42.294400Z

You can install older versions.

2021-01-28T17:03:30.294600Z

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

borkdude 2021-01-28T17:04:32.294800Z

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.

borkdude 2021-01-28T17:04:59.295Z

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

2021-01-28T17:06:12.295200Z

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

borkdude 2021-01-28T17:06:35.295400Z

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

👍 1
2021-01-28T17:06:57.295600Z

Thanks, I'l check Clover.

borkdude 2021-01-28T17:06:58.295800Z

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

clyfe 2021-01-28T17:10:40.296300Z

if you need paredit there's also this: https://github.com/ailisp/strict-paredit-vscode

pez 2021-01-28T17:11:08.296700Z

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

😂 1
pez 2021-01-28T17:14:43.296900Z

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

pez 2021-01-28T17:34:54.298800Z

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 Ami 2021-01-28T18:35:38.299900Z

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

clyfe 2021-01-28T18:38:44.301300Z

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

clyfe 2021-01-28T18:40:00.301400Z

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

Tzafrir Ben Ami 2021-01-28T18:44:12.301600Z

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

clyfe 2021-01-28T18:45:44.301800Z

Are you on latest Calva?

pez 2021-01-28T18:47:00.302700Z

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

clyfe 2021-01-28T18:47:03.302900Z

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

Tzafrir Ben Ami 2021-01-28T18:48:21.303900Z

version v2.0.155 with Java Corretto-15.0.1.9.1

pez 2021-01-28T18:48:48.304600Z

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

😂 1
clyfe 2021-01-28T18:54:08.304900Z

cc @ericdallo ^

clyfe 2021-01-28T19:05:27.305100Z

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.

ericdallo 2021-01-28T19:10:38.305300Z

Is that the latest calva @pez?

clyfe 2021-01-28T19:12:44.305500Z

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

clyfe 2021-01-28T19:13:02.305700Z

on mostly empty project

bringe 2021-01-28T20:45:08.307200Z

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

ericdallo 2021-01-28T20:53:34.307400Z

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

ericdallo 2021-01-28T20:55:08.307600Z

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

pez 2021-01-28T21:33:11.307900Z

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.

pez 2021-01-28T21:34:22.308100Z

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.

2021-01-28T21:35:09.308300Z

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

😶 1
pez 2021-01-28T21:37:47.308500Z

Yes, we have that saying here as well.

bringe 2021-01-28T22:17:45.308800Z

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

👍 1
bringe 2021-01-28T22:19:24.309100Z

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