Skip to content

Commit 9b1c9ae

Browse files
committed
cider-auto-jump-to-error: also recognise macroexpansion errors
1 parent 19c4666 commit 9b1c9ae

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cider-eval.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ It delegates the actual error content to the eval or op handler."
523523
(defconst cider-clojure-1.10-error `(sequence
524524
"Syntax error "
525525
(minimal-match (zero-or-more anything))
526-
"compiling "
526+
(or "compiling "
527+
"macroexpanding ")
527528
(minimal-match (zero-or-more anything))
528529
"at ("
529530
(group-n 2 (minimal-match (zero-or-more anything)))

test/cider-eval-tests.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,12 @@
4848
(with-temp-file filename
4949
(insert "🍻"))
5050
(expect (cider-provide-file filename) :to-equal "8J+Nuw=="))))
51+
52+
(describe "cider-extract-error-info"
53+
(it "Matches Clojure compilation exceptions"
54+
(expect (cider-extract-error-info cider-compilation-regexp "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")
55+
: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"))
56+
(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")
57+
: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 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")
59+
:to-equal nil)))

0 commit comments

Comments
 (0)