Fork me on GitHub
#calva
<
2020-08-02
>
Nathan K09:08:50

Hi 👋 I'm fairly new to clojure. I couldn't find a way to stop a run-away loop before in the calva REPL in vscode. It just kept writing to the output file. Is there a trick to stopping this sort of thing?

pez09:08:59

Hi @nathan.l.kramer, welcome! You can try the command Calva: Interrupt Running Evaluations. But it depends a bit on how asynch or not the loop runs.

👀 3
pez11:08:22

An update to Calva just released. It adds a peek definition pointer to the evaluated forms, so that even if you are not displaying the output window on the screen while you evaluate code, you can quickly peek into it using VS Code's Peek Definition command. See the docs for a demo: https://calva.io/output/#peek-at-results

🎉 9
Aleed18:08:07

previously with only the output window, anytime the evaluated output was an error, I was running the fold command to make the output more legible. which worked, but was a bit tedious but the peek definition opens at the top of evaluated output (in most cases at least)*, and in general makes it much more navigable, really great, thanks for all your work!

❤️ 6
pez20:08:44

It feels a bit bad abusing the peek-definition like this, but, hey, it works! 😃

mikeb01:08:45

I like it, pragmatic 😀. Could you possibly inspect the length of the result and if it's longer than some limit it automatically shows the peek?

pez07:08:31

Might be possible. Please add an issue about it.

Aleed14:08:35

I think rather than automatically showing peek (since a popover an be intrusive), automatically folding the repl window output would be nice

pez15:08:45

I don't think that's possible. There's only a way to fold the current editor. As far as I have understood things.

Aleed15:08:41

yeah I’ve never worked on a vscode extension, just thought maybe it’d be possible to fold the repl output programmatically, but if that requires focusing in and out of editor windows may be quite tricky to do

pez16:08:54

The editor object does not expose an API for it. So we would need to execute the fold command, which operates on the active editor.

ikrimael17:08:22

@pez related: what are your thoughts on this type of workflow: https://youtu.be/rh5J4vacG98?t=1085 e.g. not interesting enough/great but not easily supported/etc

mikeb02:08:55

Unfortunately not possible in vscode yet, but at least it's on the backlog now. See https://github.com/microsoft/vscode/issues/3220

👍 3
pez22:08:22

That looks super awesome. We can't really create inline result widgets like that yet in vscode, but it would be possible to create something like it using tree views (in the Explorer area).

👌 3