-
-
Notifications
You must be signed in to change notification settings - Fork 649
Use the cider--display-interactive-eval-result
for more cases of compilation errors
#3495
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I would be willing to give this a shot, but am not familiar enough with the inner workings of CIDER to know where to begin. If I could get a few pointers, where to start looking, what sorts of things to look out for, I could see if I can figure something out. |
cider-eval.el features a series of 'handler' defuns, please grep for: Then, it's a matter of locating the relevant handler for cider-load-buffer, and modify it such that As noted in the OP we also want to reliably jump to the relevant line. That is accomplished with the Probably we want to only jump if the line:col is not 0:0 (some compilation errors are reported like that). Hope it helps! |
Thanks for the info, @vemv! It turns out
The question then becomes why it doesn't seem to work. Debugging reveals that it is unable to find the location from the error. It looks like the regex being used does not match the syntax error message. The pattern matches this:
but my error message is
Adding this to the Any thoughts on further steps from here? |
I'd say that the problem is that cider-handle-compilation-errors takes care of the squiggly and the jumping, but the overlay is provided via this separate call:
You can see both in action here |
Loading a buffer sometimes fails silently, since `cider-handle-compilation-errors` currently does not properly parse all syntax errors. The pattern matches: > Syntax error compiling at > Syntax error macroexpanding at but needs to also match: > Syntax error reading source at This PR fixes this by adding the missing string to the regex. There is a relevant issue, clojure-emacs#3495, but that is larger in scope. Since evaluating code and getting no feedback about syntax errors is a bad experience, I propose that this be fixed without waiting for the additional quality of life improvements in that issue.
Loading a buffer sometimes fails silently, since `cider-handle-compilation-errors` currently does not properly parse all syntax errors. The pattern matches: > Syntax error compiling at > Syntax error macroexpanding at but needs to also match: > Syntax error reading source at This PR fixes this by adding the missing string to the regex. There is a relevant issue, clojure-emacs#3495, but that is larger in scope. Since evaluating code and getting no feedback about syntax errors is a bad experience, I propose that this be fixed without waiting for the additional quality of life improvements in that issue.
Loading a buffer sometimes fails silently, since `cider-handle-compilation-errors` currently does not properly parse all syntax errors. The pattern matches: > Syntax error compiling at > Syntax error macroexpanding at but needs to also match: > Syntax error reading source at This PR fixes this by adding the missing string to the regex. There is a relevant issue, clojure-emacs#3495, but that is larger in scope. Since evaluating code and getting no feedback about syntax errors is a bad experience, I propose that this be fixed without waiting for the additional quality of life improvements in that issue.
Loading a buffer sometimes fails silently, since `cider-handle-compilation-errors` currently does not properly parse all syntax errors. The pattern matches: > Syntax error compiling at > Syntax error macroexpanding at but needs to also match: > Syntax error reading source at This PR fixes this by adding the missing string to the regex. There is a relevant issue, clojure-emacs#3495, but that is larger in scope. Since evaluating code and getting no feedback about syntax errors is a bad experience, I propose that this be fixed without waiting for the additional quality of life improvements in that issue.
I think (@vemv edit: fixed in cider 1.10) |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your contribution and understanding! |
This issue been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it. |
Uh oh!
There was an error while loading. Please reload this page.
An overlay is displayed through
cider--display-interactive-eval-result
when a compilation error happens, but only when doing interactive evaluation.(Note that that is the intended design, and fully makes sense: we use something named cider--display-interactive-eval-result)
However, from a user point of view, it is desirable to show this overlay under more use cases, which may not go under the
cider-interactive-eval-handler
(the part responsible for callingcider--display-interactive-eval-result
)cider-load-buffer(done)For both cases, besides from the display of an overlay, the jumping to the right line, as introduced in #3492 should also be offered. It might be more tricky for cider-refresh, since the cause of the error may reside in another file (possibly without a corresponding open buffer).
The text was updated successfully, but these errors were encountered: