This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-28
Channels
- # aleph (3)
- # babashka (66)
- # beginners (96)
- # calva (45)
- # clj-kondo (28)
- # clojure (30)
- # clojure-dev (2)
- # clojure-europe (20)
- # clojure-germany (22)
- # clojure-norway (4)
- # clojurescript (176)
- # clojutre (1)
- # cursive (23)
- # datalog (6)
- # datomic (7)
- # docker (3)
- # emacs (3)
- # exercism (4)
- # figwheel-main (5)
- # fulcro (8)
- # gratitude (9)
- # hyperfiddle (8)
- # introduce-yourself (2)
- # jobs (2)
- # malli (4)
- # membrane (3)
- # off-topic (17)
- # polylith (3)
- # portal (2)
- # re-frame (27)
- # reitit (3)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (152)
- # spacemacs (8)
- # tools-deps (15)
- # vscode (1)
- # xtdb (24)
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?
When evaluation takes a long time, i just have to wait without knowing "something is being evaluated now".
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.
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 😊
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.
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.”
In intelliJ, we can see "something is being evaluated" because of this "Interrupt Current Evaluation" button is turned on.
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.
It's the first day of Calva. If I get used to it, I think I can recognize the evaluation status. 😄
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 https://calva.io/getting-started/#theres-a-getting-started-repl.
Cool! Those tutorials helped me get started quickly. I can also recommend checking out https://www.youtube.com/watch?v=d0K1oaFGvuQ 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!
@U027B5AEPCG Please provide your use cases, and information about prior art to this issue: https://github.com/BetterThanTomorrow/calva/issues/1543
@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) ?@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.
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.
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?
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.
just to note: jackIn.calvaJackout()
is called on deactivate
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).
ahh right the persistent sessions stuff
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.