Skip to content

Commit cd5cbb3

Browse files
authored
Add missing case for Clojure 1.10 syntax errors (#3506)
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 commit fixes this by adding the missing string to the regex.
1 parent 7a49438 commit cd5cbb3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cider-eval.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@ It delegates the actual error content to the eval or op handler."
562562
"Syntax error "
563563
(minimal-match (zero-or-more anything))
564564
(or "compiling "
565-
"macroexpanding ")
565+
"macroexpanding "
566+
"reading source ")
566567
(minimal-match (zero-or-more anything))
567568
"at ("
568569
(group-n 2 (minimal-match (zero-or-more anything)))

test/cider-eval-tests.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,7 @@
5555
: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"))
5656
(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")
5757
: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"))
58+
(expect (cider-extract-error-info cider-compilation-regexp "Syntax error reading source at (/Users/vemv/haystack/src/haystack/parser.cljc:13:0).")
59+
:to-equal '("/Users/vemv/haystack/src/haystack/parser.cljc" 13 0 cider-error-highlight-face "Syntax error reading source at (/Users/vemv/haystack/src/haystack/parser.cljc:13:0)."))
5860
(expect (cider-extract-error-info cider-compilation-regexp "Syntax error FOOING 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")
5961
:to-equal nil)))

0 commit comments

Comments
 (0)