cider-nrepl icon indicating copy to clipboard operation
cider-nrepl copied to clipboard

Remove extra error metadata that appears in the stacktraces for Clojure 1.10

Open bbatsov opened this issue 6 years ago • 9 comments

In Clojure 1.10 there's some extra info displayed in the stackframes. See this:

image

The maps with the error info and the spec failure are basically white noise and should probably be removed, although we might want to extract some info from the spec failure metadata.

See also the related https://github.com/clojure-emacs/cider/issues/2443

@jeffvalk @clojure-emacs/cider Any thoughts/suggestions here?

bbatsov avatar May 05 '19 15:05 bbatsov

I'm all for it 😄

Can we perhaps call ex-triage if running Clojure 1.10+?

alexander-yakushev avatar May 05 '19 17:05 alexander-yakushev

Yeah, I think that's a good idea. In general there's a bit of work to be done with respect to error handling as after 1.10 we still have no compilation highlights and you can no longer click on error messages in the REPL. Probably there we should move to getting the info from *e or the middleware response instead of parsing strings that can change. Anyways, that's not directly related to this ticket.

bbatsov avatar May 05 '19 17:05 bbatsov

Hi @bbatsov,

I was able to remove the white noise from clojure.spec. Attaching a screenshot of cider-error when evaluating (let [1]) with Clojure 1.10.1.

Screenshot 2020-02-17 at 4 01 04 PM

What information from clojure.spec.alpha do you think is useful? I think that :pred is certainly useful. How should we display it?

From clojure.error, I think :phase and :symbol are useful. What do you think?

@cartmanishere helped me with this. 😄

suvratapte avatar Feb 17 '20 10:02 suvratapte

Thanks for tackling this! 🙇

What information from clojure.spec.alpha do you think is useful? I think that :pred is certainly useful. How should we display it?

My original intention was to hide all the info from the maps and potentially show the important info in some way that fits better the UI. Potentially all the info in the error maps is useful, but the real problem is that those maps don't fit very well the stack frames. I'm wondering if we can just add some button that people can press to expand the data in the stacktrace maps.

bbatsov avatar Feb 18 '20 20:02 bbatsov

Hmm, I agree. I will think about where it can go in the UI. Do we have any UI mocks for this? Or other places where we use such buttons?

suvratapte avatar Feb 20 '20 08:02 suvratapte

You can see such a button in the *nrepl-messages* buffer.

bbatsov avatar Feb 20 '20 10:02 bbatsov

@bbatsov : I looked at the buttons in *nrepl-messages* buffer. Would a toggle (like the ones here: Hide: Clojure Java REPL Tooling Duplicates) work? In my opinion, a toggle would fit better than the expanding buttons on *nrepl-messages* buffer. I don't know what the name of the toggle should be though. Spec maybe?

suvratapte avatar Feb 27 '20 09:02 suvratapte

I think that's a great idea! We should have thought of this earlier.

Spec maybe?

Sounds good!

bbatsov avatar Feb 27 '20 14:02 bbatsov

Cool. Will begin work on this after 3rd March.

suvratapte avatar Feb 27 '20 14:02 suvratapte