If I put this in a file:
(defn foo
[x]
(println "Calling foo with" x)
(+ x 23))
(defn buggy [x]
y)
(foo 5)
and do Calva: Evaluate current file then no error message (or output from any of the code) appears in "Calva says", the VSCode terminal, the OS terminal in which I started the REPL, or anywhere else that I can see.
If I comment out the definition of buggy, then I see => 28 in Calva says, but not the output from println, which I don't see anywhere else either.
Error messages, printed output, and return values should all appear somewhere, ideally in the same place.
Whether all return values from all expressions in the file, or just the last one, should be printed is a question on which I don't think I have a strong opinion; I think I've seen both approaches in other Lispy environments.
Thanks. You are right that this needs to be working well. I have it high on my todo-list now.
That's a weird one. Thanks for the reproduction! I will dig into that next week
It is poor error reporting on several layers.
buggy form, of course that error should be visible and not just silent, like it is now.Note to Calva devs: I think I would like the error throwing a stack trace in the new REPL window. A bit like Cider does it.
Also, we should be looking for the output from the Load file operation and print it. The output is echoed to Calva says when executing the function (calling (foo 5)in this case).
Until this is fixed, the workaround is to look for some results from the Eval current file command (in the Calva says output channel. If you get a result (even if it is nil) the file could be compiled. If you don't get results, something prevented the file from compiling.
To find out what went wrong, for now, you'll need to evaluate suspected top level forms individually (ctrl+alt+v space with the cursor anywhere in the form). Sometimes this needs to be done methodically from the top and down, like the Clojure reader/compiler does it.
I should have been more clear: my file did include an ns declaration, so that wasn't the problem. It was a file from a large, existing project, with a simple ns declaration, simply (ns clojush.ns), and an unproblematic macro definition. The code pasted in above followed that material in the file.
This should be fixed in v1.3.65. Please upgrade peeps!