-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more control of stacktrace formatting. #521
Conversation
I'll probably be replacing this inlined code with some middleware. There's a problem with just adding other stacktrace libs (like |
The middleware approach does make more sense. I'd considered that too, but figured I'd submit something simple. Anything deliberate seemed better than the Which current code fails on some stacktrace formats? Your point about coordination between formatter and parser stands to reason; I'm just curious where this interaction lives (or should). |
See |
I had a closer look at the code in question, and if I'm seeing this correctly, the output parsed for compile errors/warnings is separate from the formatted stacktrace presented in the popup buffer. An eval request will cause both, but not dependently. (The former is read from the eval Like you mentioned, migrating these functions to middleware seems like a good tack. Is this something you'd entertain pull requests for? In particular, I'm thinking of moving stacktraces from a static printed representation to something navigable using the actual stack frame info. I have a preliminary version of the middleware running, but I don't want to wander to far if you already have a roadmap in mind. |
Hmm, I'm pretty sure I parsed the stacktrace in the popup buffer at some point, but I guess I might have changed that (or someone else did and I forgot about it). Yeah, I'd certainly take a PR for that. Unfortunately I'm under a mountain of work these days and my plans for cider improvements are mostly on hold, so it's up to users to implement features that want to see sooner rather than later. |
Fair enough. I will send you a PR hopefully this week (schedule permitting). |
@jeffvalk Ping :-) |
Yeah, that was longer than advertised. :-) I had this mostly complete last week...then non-coding things started clamoring for attention. I just got to look at it again last night. I'll tidy up and get it to you this evening. I take it the middleware should be a PR to the |
Yep. |
Thought this was good to go, but while tidying up, I found a possible bug. Will chase it down. |
Sources updated. The middleware for this is |
Overall the code looks good, but I'll have a closer at it tomorrow. One thing I noticed is that you haven't mentioned the new functionality in the README and the CHANGELOG. |
My oversight. I updated the documentation in both projects. |
(let ((replp (with-current-buffer buffer (derived-mode-p 'cider-repl-mode)))) | ||
(when (or (and cider-repl-popup-stacktraces replp) | ||
(and cider-popup-stacktraces (not replp))) | ||
(lexical-let (causes frames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cider uses lexical scoping by default. Replace lexical-let
with a plain old let
.
Address my minor remarks, rebase on top of the current |
Update documentation for stacktrace filtering/navigation. Update face names and doc strings for clarity. Add cider-stacktrace group. Tidy up.
The |
Allow more control of stacktrace formatting.
Thanks! |
Currently stacktraces are printed with
clj-stacktrace
, if available, orclojure.stacktrace
otherwise. To use a different print function, the common approach seems to be to callalter-var-root
on one of these in the lein profile -- a bit of a hack.This lends some flexibility to stacktrace printing by adding
io.aviso.repl/pretty-pst
as another automatically searched option (likeclj-stacktrace.repl/pst+
), and defining a variable with which the user can override the built-in defaults.