Fork me on GitHub
#calva
<
2020-08-20
>
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

bringe01:08:25

There may actually be an recent issue with that. I noticed today I'm not seeing stacktraces, which should be printed with errors afaik.

3
bringe01:08:06

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

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

bringe01:08:05

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

bringe01:08:45

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

bringe01:08:13

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 😕

bringe01:08:43

Are you using shadow-cljs?

bringe01:08:34

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

bringe02:08:08

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

bringe02:08:22

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

bringe16:08:04

: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
gmercer06:08:38

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)

pez06:08:46

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

gmercer06:08:33

ctrl+alt+c o gives key combination not a command

gmercer06:08:57

sorry - from project.clj it works 😉

gmercer06:08:08

the old window also coped with Enter to execute command but we must use Ctrl-Enter now 😞

gmercer06:08:20

Calva is an amazing tool - thanks to all contributors

pez06:08:33

Use alt+enter, for now.

gmercer06:08:07

ooh .. for now - sounds intriguing

gmercer06:08:09

The 'new' window seems amazingly snappy at code completion

pez06:08:30

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.

pez06:08:33

See https://clojureverse.org/t/calva-summer-of-bugs-2020/6303 for a bit of the rationale with the shift.

gmercer06:08:11

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

pez06:08:46

What was not happy about the new style?

pez06:08:37

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.

gmercer06:08:05

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

pez06:08:03

Interesting, hoping for a quick recovery there then. This sounds important.

gerred15:08:37

@pez what’s the consequences if I close the new repl and evaluate inline? 🙂

gerred15:08:00

doesn’t seem like there’s anything atm

gerred15:08:10

but I just noticed the line “please keep open, because quirks” 😂

pez15:08:09

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.

bringe16:08:45

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

bringe16:08:57

Just a theory though, have not tested that assumption

bringe17:08:53

Calva v2.0.122 is out and stacktraces are fixed (now showing again in the output window) @mail985

❀ 6
parrot 3
grounded_sage18:08:06

Does calva use the same rules as cljfmt for it’s formatting?

pez18:08:08

Yes. In fact Calva is using cljfmt. And you are in charge is the rules. https://calva.io/formatting/

❀ 3
borkdude20:08:32

Just dropping that here for whoever wants to take it

❀ 3
bringe23:08:44

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:

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
bringe23:08:35

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

metal 3
bringe23:08:30

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