Fork me on GitHub
Jack Arrington01:08:04

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

Jack Arrington01:08:38

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

Jack Arrington01:08:22

Awesome, thanks!

👍 3
Jack Arrington01:08:23 If you need a more detailed bug report or repro steps I can edit it tomorrow, I am too tired tonight lol


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

Jack Arrington01:08:10

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


Indeed, this button in the bottom right of the status bar toggles pretty printing of output


There is also a command that toggles it

Jack Arrington01:08:33

Okay, I thought that might be what that's for. But my pretty-printing is turned on

Jack Arrington01:08:39

Just not working 😕


Are you using shadow-cljs?


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:


@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.


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

Jack Arrington11:08:32

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

Jack Arrington21:08:34

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

👍 3
Jack Arrington02:08:16

Ah, I see. Thanks for the help!

👍 3

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 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

❤️ 6
parrot 3

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.

❤️ 3

Just dropping that here for whoever wants to take it

❤️ 3

Calva friends and testers: I could use some help testing this 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)
      (recur (dec i))))
And generally just see that no other output looks weird or is missing :man-shrugging:

Cris B07:08:37

Been running this today (on Win). Nothing interesting to report. I've been getting the '; Evaluation was interrupted' when expected

❤️ 3

As far as what to expect with interrupted evals - something like this:

metal 3

Sometimes that "Execution error"/"sleep interrupted" is thrown and sometimes not, but nevermind that.