Fork me on GitHub
#calva
<
2023-12-15
>
David Yang01:12:21

hey - curious if there’s any new thoughts on this issue given the Calva eval API? https://github.com/BetterThanTomorrow/calva/issues/76 I have a project that spins up a JVM for a server process and a separate JVM for shadow-cljs, right now I do the two workspace method

pez09:12:40

Hi! With the Calva eval API, do you mean this? https://calva.io/api/#repl

pez09:12:30

Is you project using Clojure for the backend and ClojureScript for the frontend?

David Yang13:12:44

Hey @pez - yeah was wondering if something could be built on the eval API that would let me connect to two different REPLs. I have a project that is running Clojure on the server and Clojure/ClojureScript to generate a React Native client. Right now I have to jack-in to two different projects using two different VS Code windows

pez13:12:30

The evaluation API suffers from the same limitations as Calva here, unfortunately. Can we have a look at your project setup and see if we can get the Clojure server to host the ClojureScript repl? I’m available for a huddle, if you like.

David Yang13:12:53

sure - that’d be much appreciated!

David Yang13:12:19

is a huddle like avoice chat? or just a separate channel?

cmdrdats09:12:00

weird question: does anyone know if it's possible to embed images into the code in vscode/calva? (likely in comments)

pez09:12:21

All I can think of is if notebooks may be able to support that.

cmdrdats09:12:17

just doing a fair bit of UI work, so would be nice to add a thumbnail floating right of the function definition (or even above) to give a bit more visual cue to the code I'm working with.. heck, first prize would be to render the rum component to html and inline it there.. but that sounds like quite the project :face_with_peeking_eye:

pez09:12:23

Maybe @U1G869VNV has some pointers on how to leverage #C0185BFLLSE for things like this.

Jacob Emcken10:12:43

Only ever used ascii drawings and emojies myself. Have you considered to just write a url or relative file path and then look for a VS Code plugin that will show the contents?

cmdrdats10:12:48

ye, that would work fine except that I can't really find anything except a tooltip one 🙈

pez10:12:07

There’s an old VS Code API proposal that would give us more tools for doing this, but there are no current plans to finalize it. https://github.com/microsoft/vscode/issues/85682

cmdrdats10:12:55

aww - oh well. I suppose it's a bit much to ask for a relatively niche oddity

David Yang13:12:44

Hey @pez - yeah was wondering if something could be built on the eval API that would let me connect to two different REPLs. I have a project that is running Clojure on the server and Clojure/ClojureScript to generate a React Native client. Right now I have to jack-in to two different projects using two different VS Code windows

wcohen14:12:04

Just a random thank you -- can't use WSL on my new computer at work, msys2 emacs is fighting me, so after a decade finally taking the plunge of trying to use clojure without linux/emacs, and calva got me up and running very smoothly

👍 3
❤️ 1
calva 1
pez15:12:59

Thanks for letting us know! I love to hear about this.

Raghav03:12:17

just curious, why you can't use WSL?

wcohen12:12:37

New job, city govt, no one in my department does programming. Getting a JDK was already out of the ordinary. Maybe once I’ve been there a while I can ask to install something more wacky. No formal policy!

pez16:12:17

Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.402 • Fix npm audit warnings, bump some deps, clean out some deps • https://github.com/BetterThanTomorrow/calva/issues/2365 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2368 The bump to latest cljfmt should help in projects suffering from formatting missmatch between Cursive and other editors.

🙌 1
pez16:12:35

Thanks for the reminder about selecting words inside line comments, @U034568PWRW. Now you should not need those custom settings you showed me. Let me know how you fare!

David Yang18:12:34

Awesome! Thanks @pez

Tom Helmuth16:12:40

Is there any way to easily interrupt a long or infinite loop that's constantly printing things to the REPL? Calva: Interrupt Running Evaluations works great if things aren't printing, but if things are printing, this doesn't work and jacking out doesn't either. I even get this problem in CPU-intensive tasks that only print once every few seconds -- if I interrupt the task, it seems to keep evaluating for many seconds (or minutes) afterward.

pez16:12:16

Hi! I was not aware of this problem. Can you create a reproduction project that we can have a look at?

Tom Helmuth16:12:02

Sure, I'll give it a shot later today.

wcohen18:12:31

I was just about to ask the same thing! I don't have a good example project since it's my first day in calva...

wcohen18:12:34

It appears it might just be the lag of the printing to the calva window itself

pez19:12:16

You can enable the nrepl message log (there’s a command for that) and see if messages are being printed with lag to the output window.

Tom Helmuth15:12:15

So, something as simple as this just won't interrupt:

Tom Helmuth15:12:22

(doseq [x (range)]
  (println x))

Tom Helmuth15:12:22

Even if I disconnect from the REPL, it keeps going. The only way I can get it to stop (on MacOS) is to open Activity Monitor, find a process called Code Helper (plugin), and force quit it.

Tom Helmuth15:12:29

Where, if I open a REPL in my Terminal and run that code, I can quit it instantly with ctrl-C

gdubs20:02:43

With emacs, I'm pretty sure I could ctrl-c the repl window and it would interrupt, but not kill the repl.

pez20:02:38

The ctrl+c mentioned above is not in the repl window, but the jack-in terminal. You can bind interrupt to ctrl-c in the REPL window with Calva too. But on Windows and Linux that may be a bit inconvenient, since ctrl+c is supposed to copy stuff.

gdubs20:02:10

yeah, but I assumed that it would kill the repl process? Or does it just send a signal and the repl just interrupts? I'll test it!

gdubs20:02:55

it kills! I'd like to interrupt, if possible. I wonder if the repl supports different signals for different things.

pez20:02:28

I think we are talking about different things. The repl window in Calva is not the same as the jack-in terminal.

gdubs21:02:04

Yeah, I think I misunderstood something along the way thinking that someone was saying that ctrl-c'ing the jack-in window would interrupt. Looking above, nobody said that! To summarize: • ctrl-c in the jack-in window will kill the repl • The Calva: Interrupt Running Evaluations command will do what it says. • ctrl-c in the repl window can be bound to the-above. Above, you said: > As for stopping the thread started by that doseq call there… I don’t think you can. The Calva: Interrupt Running Evaluationscommand interrupted the doseq for me. Am I missing something? Thanks for your patience with me!

pez21:02:58

Your summary shows that we are on the same page now. 😃 > The Calva: Interrupt Running Evaluationscommand interrupted the doseq for me. Am I missing something? I actually have the same observation. Asked about it here: https://clojurians.slack.com/archives/C17JYSA3H/p1702810229980689 Not sure where this leaves us.

👍 1