Fork me on GitHub
#cider
<
2019-09-27
>
pez10:09:17

What would CIDER do? (A question I often ask, when hacking on Calva). Right now I don't have Emacs handy, though, so here goes. What does CIDER do when you evaluate to comment and an error is thrown?

rickmoynihan12:09:03

;; => is what I get ๐Ÿ˜

rickmoynihan12:09:55

When running M-x cider-pprint-eval-last-sexp-to-comment on (throw (ex-info "foo" {}))

pez12:09:16

Thanks! It is sort of true. But I think I'll try to include some little more info. ๐Ÿ˜ƒ

rickmoynihan12:09:26

Yes it isโ€ฆ I also get the *cider-error* buffer pop up โ€” not sure if configuring it differently would change the behaviour though

pez13:09:34

I'm looking at how to support the Design Journal that @jr0cket mentioned in the ClojureScript podcast better. Then it makes sense to include some of the error message in the comment, me thinks.

bozhidar13:09:45

@rickmoynihan Thatโ€™s definitely a bug. ๐Ÿ™‚ Itโ€™d be nice if you reported it. I think nothing should be printed in the comment at all in such cases and users should just get the error buffer.

pez14:09:18

> I think nothing should be printed in the comment at all in such cases and users should just get the error buffer. That's what Calva does today. ๐Ÿ˜€ But it makes a boring design journal.

bozhidar14:09:58

Iโ€™ve got no issues with boring. Printing the condensed error message is always an option, but it seems pointless to me if you get a stacktrace buffer alongside anyways.

pez14:09:14

It is in the design journal context that I think it is not pointless: https://github.com/jr0cket/tictactoe-reagent/blob/master/src/tictactoe_reagent/core.cljs

jr0cket14:09:31

I will sometimes copy the most interesting part of an error message to a comment under the expressions

jr0cket14:09:21

Especially of it's a useful learning experience or a common error the team experiences

qythium14:09:18

somewhat related, but I'd actually like it if there was an option to display error messages in the result overlay without popping up an error buffer

qythium14:09:29

90% of the time it's a simple typo and I don't need to see the entire stacktrace and spend half a second dismissing the popup window

jr0cket15:09:49

@qythium what you ask for is what I use clj-kondo for, it picks up typos and many other errors and warnings. It works as a backend to flycheck

qythium16:09:30

Yeah, I use flycheck-clj-kondo also, but it doesn't pick up on everything (eg. "typos" where I pass arguments in the wrong order)

qythium16:09:24

just hacked together a prototype to try out over the next few days and see if it's a good idea ๐Ÿ™‚

bozhidar21:09:08

@qythium I like the idea. Feel free to send a PR.

bozhidar21:09:00

I guess the only thing we need to consider is how to summon the stacktrace buffer in those cases, as I assume we wonโ€™t be showing it if we are relying on the overlay to communicate the error.