Fork me on GitHub
#calva
<
2020-05-04
>
pez06:05:47

Can you maybe use the jar instead, @hoppy?

jurjanpaul50211: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?

pez11:05:57

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

jurjanpaul50211:05:56

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

(do
    (println "hello world")
    (flush)
    (/ 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?

jurjanpaul50211: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. 🙂

brandon.ringe18:05:31

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

brandon.ringe18:05:16

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

brandon.ringe16:05:12

Thanks for the issue!

pez12:05:15

Sounds reproducible. Please file an issue.

jurjanpaul50215:05:54

Thanks. I will!

gerred15:05:00

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

gerred15:05:57

stack trace doesn't seem terribly useful.

gerred15:05:13

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

gerred15:05:07

but I'm on VSCode on OSX

gerred15:05:03

I think I have a repro

gerred16:05:43

added it to the issue.

pez17:05:48

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

gerred21:05:34

@pez you did. One more manifestation

gerred21:05:59

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

gerred21:05:44

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

gerred21:05:33

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

gerred21:05:54

wow nevermind

gerred21:05:54

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