Fork me on GitHub
#calva
<
2019-04-01
>
pez06:04:15

I don't know what's going on. Will look at it.

pez09:04:20

I updated the issue now with some comments on the problem.

lspector13:04:37

I replied that I don't think it was actually an ns issue... but now I'm getting some confusing results. Will start with a new, empty project and report what I'm seeing later today I hope. Thanks!

hoppy14:04:49

with the errors missing, this is the only way I've found to reason about whether eval-file works or not

hoppy14:04:25

if you are missing that nil repsonse, it didn't succeede

pez15:04:52

Yeah, that's what I wrote in the comment as well. https://github.com/BetterThanTomorrow/calva/issues/146 Even though the result can be something else than nil, it should just be the eval result from the last form.

lspector16:04:17

Tried with a new project and am more confused now 馃槙. I did lein new calvatest, opened the project with VSCode, did cd calvatest and lein repl and then connected Calva to the REPL, and then if I put my cursor in the ns form in src/calvatest/core.clj and do "Evaluate selection or current form" then I get (inline in the editor, from where I can't copy text) => Syntax error (ClassNotFoundException) compiling at ...

lspector16:04:14

I was able to get "Run Selected Text" to work again in the new project, although it took some juggling that I'm not sure how to re-create, with the text initially being sent to a shell terminal rather than the Clojure REPL.

lspector16:04:07

But bottom line I can't see how the printing to "Calva says" works in the new project because I can't get the "Evaluate" (as opposed to "Run") items to work.

lilactown16:04:00

FWIW I'm using Calava 1.3.64 (the one in the marketplace) and your steps work fine for me

lilactown16:04:43

位 lein new calvatest
Generating a project called calvatest based on the 'default' template.
The default template is intended for library projects, not applications.
To see other templates (app, plugin, etc), try `lein help new`.
 位 cd calvatest
 位 lein repl
nREPL server started on port 54615 on host 127.0.0.1 - 
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
...

lilactown16:04:42

I evaluate the ns form, then defn foo .., (foo) and (foo "a") using Calva: Evaluate selection or current form

lilactown16:04:35

my "Calva says" output looks like

lspector17:04:35

huh -- thanks for the report @lilactown! Will try again, maybe this time quitting/restarting VSCode first...

pez17:04:53

@lspector , I think what was missing for you was that you did not load the file before you evaluated the form.

lspector19:04:09

Ah... true that I didn't load the file... and YES that fixes it! So that adds another step that has to be done... (will try to remember! perhaps this process is documented somewhere I've missed it, or could be?)

lspector19:04:49

I am also now seeing println output in Calva says, when I use "Evaluate ..." commands, so that's great.

lspector19:04:27

I'm seeing some error messages now too... not sure why, of it's reliable, but glad to see that.

lspector19:04:18

But here's something weird: whenever I edit my code and save I see "Evaluating file: ..." in Calva says. Is it really evaluating it? It is not printing results which should be if it were evaluating it. In any event, I do not want it evaluating anything when I save. I realize some environments evaluate things on saving, but I think that can be really problematic. I want it to evaluate only when I tell it to, and only to save when I tell it to save.

lspector19:04:05

One other piece of more minor feedback re: the "Evaluate ..." commands: Can I prevent it from putting results in the editor pane? The most important thing for me is that the results do go to some other text output place, as they now appear to go to Calva says (I'm not completely clear on how correct/reliable this is yet, but it's the right idea). But FWIW I find it confusing for them also show-up-but-not-actually-be in the editor pane, particularly for large values. If they do have to appear there, is there a way to clear them other than changing the text in the editor?

pez20:04:24

Press ESC to dismiss the inline displayed results.

lspector20:04:27

Ah -- nice -- thanks

lspector21:04:06

Experimenting with def forms and printing values it looks like saving doesn't actually re-evaluate the file, which is great, but it makes the "Evaluating file:" message that appears in "Calva says" a bit more mysterious.