Fork me on GitHub

Can you maybe use the jar instead, @hoppy?

Jurjan-Paul Medema11:05:13

Relatively new to Calva, I'm wondering why (flush) doesn't actually flush stdout to the output panel during (nREPL) evaluation of a form. I've observed this in situations where the evaluation takes some time (e.g. waiting for IO) or evaluation is paused in the debugger. When an exception gets thrown, what was printed before never even appears (unless I catch the exception within the form of course). Is there anything else I can do to force the flush to the output panel after all? Or is this actually an nREPL issue?


Not sure what kind of issue it is. I don't think Calva is aware of any (flush).

Jurjan-Paul Medema11:05:56

Consider this form (simplest use case I can think of):

    (println "hello world")
    (/ 1 0))
When, connected to the nREPL, I evaluate it, 'hello world' is never printed. I find that strange (even when I leave out the flush). Am I wrong to expect the output?

Jurjan-Paul Medema11:05:30

(I am looking at the 'Calva says' output panel here. With the above form it does print the ArithmeticException. When I leave out the (/ 1 0), "hello world" is printed as expected (either with or without the flush.) So, in my mind 'flush' is not the issue, but some kind of stdout swapping is. I hoped it would ring a bell. 🙂


I've noticed the repl window seems to print output "as it's printed" but the Calva says window waits until execution completes (or does not print like in this case I suppose). This may have something to do with streaming output with nrepl (which Calva does not do, but I think Cider does). We have "enable using nrepl in streaming mode" on the todo list @pez


It may be related to the :nrepl.middleware.print/stream? optional param to the eval nrepl operation


Thanks for the issue!


Sounds reproducible. Please file an issue.


Has anyone seen this on 2.0.97? Activating extension 'betterthantomorrow.calva' failed: Cannot read property '0' of undefined.


stack trace doesn't seem terribly useful.


i'm going to blow away my $HOME/.vscode folder.


but I'm on VSCode on OSX


I think I have a repro


added it to the issue.


Awesome. As I wrote on the issue, I hope we are just about to nail it.


@pez you did. One more manifestation


I can't jack in and start a REPL without having a folder open.


oh I've got something weird going on, here, taking a Kap of it witht he update


so I wiped all of my vscode setup earlier today, so this is fresh. I'll cap through the whole process..


wow nevermind


I just discovered when you try to set the default "[clojure]" settings and autocomplete the setting, those settings are incorrect.