-
-
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
Add missing case for Clojure 1.10 syntax errors #3506
Conversation
There are no more cases: so LGTM! Simply make sure to expand |
51e1db8
to
68ca5b4
Compare
I have added the test. There is one failing check, a timeout on Windows. I don't see any way to trigger just that test for a re-run, so I hope this should be enough to pass. Thanks for verifying that these are the only three cases, @vemv |
test/cider-eval-tests.el
Outdated
@@ -55,5 +55,7 @@ | |||
:to-equal '("src/haystack/analyzer.clj" 18 1 cider-error-highlight-face "Syntax error compiling clojure.core/let at (src/haystack/analyzer.clj:18:1).\n[1] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings\n")) | |||
(expect (cider-extract-error-info cider-compilation-regexp "Syntax error macroexpanding clojure.core/let at (src/haystack/analyzer.clj:18:1).\n[1] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings\n") | |||
:to-equal '("src/haystack/analyzer.clj" 18 1 cider-error-highlight-face "Syntax error macroexpanding clojure.core/let at (src/haystack/analyzer.clj:18:1).\n[1] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings\n")) | |||
(expect (cider-extract-error-info cider-compilation-regexp "Syntax error reading source clojure.core/let at (src/haystack/analyzer.clj:18:1).\n[1] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings\n") | |||
:to-equal '("src/haystack/analyzer.clj" 18 1 cider-error-highlight-face "Syntax error reading source clojure.core/let at (src/haystack/analyzer.clj:18:1).\n[1] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings\n")) |
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.
The exact message I get for e.g. ::::e
is: "Syntax error reading source at (/Users/vemv/haystack/src/haystack/parser.cljc:13:0)."
Please let's reflect such a message here - the added test appears to be synthetic.
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.
Agreed, that's an improvement for sure. Done.
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.
Thanks! |
Thank you! |
Loading a buffer sometimes fails silently, since
cider-handle-compilation-errors
currently does not properly parse all syntax errors.The pattern matches:
but needs to also match:
This PR fixes this by adding the missing string to the regex.
There is a relevant issue, #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 will start work on all the checkboxes below if this seems like a fair change.
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Thanks!
If you're just starting out to hack on CIDER you might find this section of its
manual extremely useful.