Fork me on GitHub
Jungin Kwon05:04:35

How can I see something is being evaluated in Calva?


You should see the result of evaluating an expression directly in your editor and also in the REPL. What are you (not) seeing right now, and how does it differ from your expectations?

Jungin Kwon06:04:19

something like traffic light


Could you post a screenshot?

Jungin Kwon06:04:08

When evaluation takes a long time, i just have to wait without knowing "something is being evaluated now".

Jungin Kwon06:04:53

I wanna know if there is UI like "(loading...)"


If it takes a long time, then something is probably wrong. It's usually instant unless the expression you're evaluating is very computationally heavy, has an infinite loop, etc.

Jungin Kwon06:04:47

in my case, there is a http request (which is very slow) 😇

💡 1

I'm out walking the dog right now (writing from my phone), and I have a meeting at work in 30 mins. I'll come back to this thread after. Maybe someone else will be able to help in the meantime 😊

🙏 1
🐕 1

I haven't encountered a prolonged HTTP request in the REPL myself yet, but I would presume one or three scenarios might occur: expected data is returned, an error is returned, or a timeout. I would expect to see something in my editor/REPL in all three cases, but the timeout case is unpredictable. Do you have an idea of how long the HTTP request should take? Maybe the API you're calling specifies a timeout in their documentation.

Jungin Kwon07:04:57

I can see that an error has occurred because it is displayed in the output.


Aha! In that case, I suppose it’s safe to assume that evaluating the expression has finished. This might be the wrong way to think about this, but I presume that “something is being evaluated” until I see some output in my editor and REPL. I don’t know if Calva has a “traffic light” to indicate that “something is going on right now.”

Jungin Kwon07:04:58

In intelliJ, we can see "something is being evaluated" because of this "Interrupt Current Evaluation" button is turned on.

Jungin Kwon07:04:28

Okay. Thank you for your time 😀


No problem! By the way, are you doing “interactive development” by connecting VS Code to the REPL via Calva? You should see the output directly in your editor, next to the code itself (not just in the separate REPL window). I’m not familiar with IntelliJ, but it might seem like you’re “compiling and running” your code instead of evaluating expressions interactively.

bananadance 1
Jungin Kwon07:04:07

It's the first day of Calva. If I get used to it, I think I can recognize the evaluation status. 😄

👍 1

If you haven’t done so already, I recommend checking out the built-in tutorials that ship with Calva. They’re a great way to get started! Just run the command “Calva: Fire Up the Getting Started REPL” from VS Code’s “Command Palette,” then follow the instructions in the hello_repl.clj. That will show you how to do “interactive development” with Clojure in VS Code with Calva. You can find some

👍 1
Jungin Kwon07:04:26

Oh.. Thank you! I'll try right now.

partyparrot 1

Cool! Those tutorials helped me get started quickly. I can also recommend checking out by @U0ETXRFEW (the creator of Calva). It shows what “the interactive development experience” should look like with VS Code and Calva. And feel free to ask more questions in the #calva channel if you get stuck!

🙏 1
❤️ 1

@U027B5AEPCG Please provide your use cases, and information about prior art to this issue:

💡 2
😉 1
🎯 1

@U0ETXRFEW Oh! I was not aware we had a GitHub issue for that. It’s a nice usability feature.


I develop in calva, and the jack in command of calva when launching shadow is like this

npx shadow watch :app
The issue is, whenever I run the the vs command Developer reload window. And after the new vscode window show up, and then if I perform a jack in, it will say
shadow port already taken
In all, is it possible to tell shadow to quite when vscode quits (to be exact, window reloads) ?


cc @U0ETXRFEW track here.

🙏 1

@UGC0NEP4Y If you, from the jack-in terminal, first kill the repl (ctrl-c) and then reload window. Is this still happening?


<!subteam^S03BGSAUPTQ|@calva-team> I'm short of time, please chip in if you have some little time.


This will not


One thing you can do, at least as a workaround for now, is use run the jack-in command manually in a terminal in VS Code then use Calva’s command to connect the the running repl. Then when you reload the window the terminal will be restored and you can connect again. The jack-in terminal is not the same as a normal terminal in VS Code, so the behavior is different with that. You can also start the repl in a terminal outside VS Code for the same effect.

thanks3 1

You can use Calva’s command for copying the jack-in command to make this a bit easier. Search the command palette for “copy jack-in”.


Yeah, unfortunately I've observed orphaned jack-in-caused processes when vscode crashes or other unexpected quits like Reload Window. I'm not sure if there's a way exactly to inform a vscode extension like Calva to perform some kind of cleanup or "before exit" action off the top of my head. You can as stated do the non-jack-in REPL connection though! Let us know if that works for your workflow


I'm guessing you are using Linux, @UGC0NEP4Y?

Cora (she/her)23:04:30

there is, unfortunately, no consistent way for a child process to detect when a parent process has exited and so if the parent process crashes or doesn't otherwise clean up it'll end up orphaning child processes.


I am on macos. Only the npx shadow watch will have an orphan process. For other commands like react-native run metro , they will exit.


This might be related to the pseudo-terminal used for the jack-in process. @U0ETXRFEW Do you think there’s a fix for that using the pseudo-terminal? Maybe we should track this with an issue.

Cora (she/her)23:04:34

just to note: jackIn.calvaJackout() is called on deactivate

Cora (she/her)23:04:00

i'm not sure if that's called during reload, though


It is. This has been working for very long. Probably something has changed in VS Code. With some luck they are trying to bless the pseudo terminals with the same persistence that real terminals have (even if they are not succeeding quite yet).

Cora (she/her)23:04:28

ahh right the persistent sessions stuff

Cora (she/her)23:04:56

but wait, shouldn't it still be killed because of the deactivate?


You might be right about that. We should try without calvaJackOut on deactivate. Not holding my breath, but if that works then I will be crazily happy. 😃


Can confirm that it is not specifically related to shadow. When I vsocde reload window, the nrepl (jack-in process) is still there.


Not sure if it is a feature or not.. However, in any way, since it is there, the right command for the user to do is to connect to a running repl instead of jack in, which creates a new nrepl again.


Is the terminal pane for the jack-in process also still there?


No. After restart, it gives me a clean window.


Too bad. I wish I knew a way to give the Jack-in pseudo-terminal the same treatment as regular terminal processes get.