absolutely keep up the great work.
Would be nice if Calva could display a line number when an error is thrown while evaluating a form. Either in the file itself or in the REPL output
I'm working on a shadow-cljs project and I have to tab over to my browser console to see the error info
There may actually be an recent issue with that. I noticed today I'm not seeing stacktraces, which should be printed with errors afaik.
Please file an issue. I'll be able to look into it likely tomorrow
On a different note, is it currently possible to pretty-print REPL output? Currently I have a lot of outputs like the first image, which is obviously a little hard to parse at a glance, so I wind up editing it to look like the second photo so I can confirm I have the right output. Not a big deal, but the cumulative effort adds up
Awesome, thanks!
https://github.com/BetterThanTomorrow/calva/issues/758 If you need a more detailed bug report or repro steps I can edit it tomorrow, I am too tired tonight lol
Indeed, this button in the bottom right of the status bar toggles pretty printing of output
There is also a command that toggles it
Okay, I thought that might be what that's for. But my pretty-printing is turned on
Just not working 😕
Are you using shadow-cljs?
All good! I noticed earlier too and sent to @pez, but he is in a very different time zone and therefore sleep schedule, so waiting on his reply (and I'm "off" for the evening). If I'm not missing something there is something definitely wrong
Yep!
Aha! This is something I noticed recently and was confused about. shadow does pprinting differently for reasons. I added this to the docs to clarify: https://calva.io/pprint/#pprint-is-not-working-for-clojurescript
So, essentially you can change your pprint engine to "calva" in your settings, or you can set :repl-pprint to true in :devtools of your shadow-cljs build
Seems like for me switching the pprint engine to "calva" worked, but setting :repl-pprint
in my settings had no effect. Might be worth adding a note about in the docs
:repl-pprint works for me. Make sure it was added correctly and that you restarted your shadow repl / build
This is from the shadow docs: https://shadow-cljs.github.io/docs/UsersGuide.html#_repl_3
I did restart it pretty sure. I will double check that it doesn't work later. I didn't have :repl-init-ns
set, which I saw before is mentioned in that link, but I figured that shouldn't affect it
Ah, I see. Thanks for the help!
@pez maybe we should dig up the reasons we stopped defaulting to the calva pprint engine :thinking_face: . If we can switch back, then we can avoid this confusion at least in the default case.
Hi, has something changed recently in either latest Calva or latest VSCode update .. I cannot open the REPL window (had a nice orange logo inside the window and on the title bar), I am only getting the output.repl window - I used to do Command-Shift-P .. Open REPL Window (from memory)
@gmercer, yes, a recent Calva update replaced that window with the output.repl window. I do miss those sweet logos, but it is about the only thing I (as a maintainer) miss about it. The default shortcut for opening the new repl window is ctrl+alt+c o
. (And it can be opened via the command palette, like you used to do with the old window, as well.)
ctrl+alt+c o
gives key combination not a command
sorry - from project.clj it works 😉
the old window also coped with Enter to execute command but we must use Ctrl-Enter now 😞
Calva is an amazing tool - thanks to all contributors
Use alt+enter
, for now.
ooh .. for now - sounds intriguing
The 'new' window seems amazingly snappy at code completion
We could consider making enter
work in this window as well. 😃 But a big part of the point with the new window is that it works very much like a regular file, so alt+enter
should feel quite natural after a while.
See https://clojureverse.org/t/calva-summer-of-bugs-2020/6303 for a bit of the rationale with the shift.
Not a biggie - but I was using VSCode Live Share with someone .. and it was not happy about the new style .. but the old window was not shareable either .. just thought it was worth mentioning
What was not happy about the new style?
Live Share is one of the reasons for the shift. Since it wasn't really feasibly to make the old window work with Live Share.
File was unwriteable .. from memory .. I will wait for my co-conspirator to get well and try again .. might be next week .. I may have incorrectly tried to start my own repl session
Interesting, hoping for a quick recovery there then. This sounds important.
@pez what’s the consequences if I close the new repl and evaluate inline? 🙂
doesn’t seem like there’s anything atm
but I just noticed the line “please keep open, because quirks” 😂
Might be that there are none. I had some troubles with that in the first versions, but might have fixed it. Please fly like that a while and let us know. Ie would be most happy to remove that line.
I've been operating mostly without the output window open, lol. I thought the quirks were with the command to focus/open it, sometimes opening multiple editors for it in different view columns, and then having inconsistent behavior with where output goes. I never experienced this though, and maybe this was just an issue before we made calva save the file after writing to it. I think if multiple editors are open with the same doc now, if the doc is saved it should be reflected across all editors
Just a theory though, have not tested that assumption
Calva v2.0.122 is out and stacktraces are fixed (now showing again in the output window) @mail985
Does calva use the same rules as cljfmt for it’s formatting?
Yes. In fact Calva is using cljfmt. And you are in charge is the rules. https://calva.io/formatting/
Just dropping that here for whoever wants to take it
Calva friends and testers: I could use some help testing this vsix: https://7808-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.123-fix-interrupted-evaluation-output-91674a90.vsix Some minor changes were made to error printing both as annotations and in the output window, mainly to print an error when evaluations are interrupted. I've tested myself on linux, but more testing would be good, especially on Mac and Windows. Basically, install it and test out interrupting evaluations, like this (using Calva's interrupt command)
(loop [i 1000]
(println i)
(Thread/sleep 3000)
(if (zero? i)
i
(recur (dec i))))
And generally just see that no other output looks weird or is missing :man-shrugging:Been running this today (on Win). Nothing interesting to report. I've been getting the '; Evaluation was interrupted' when expected
Awesome!
As far as what to expect with interrupted evals - something like this:
Sometimes that "Execution error"/"sleep interrupted" is thrown and sometimes not, but nevermind that.