From af50b01dbebd4821e77d3af054bafe073157f122 Mon Sep 17 00:00:00 2001 From: Jonathon McKitrick Date: Fri, 17 Jul 2015 13:31:37 -0400 Subject: [PATCH] Include source/line/column in location info --- src/cider/nrepl/middleware/stacktrace.clj | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cider/nrepl/middleware/stacktrace.clj b/src/cider/nrepl/middleware/stacktrace.clj index 0e7a335cf..a337c3884 100644 --- a/src/cider/nrepl/middleware/stacktrace.clj +++ b/src/cider/nrepl/middleware/stacktrace.clj @@ -104,8 +104,13 @@ from its message and discard the string representation of its inner cause." [{:keys [class] :as cause}] (if (= class "clojure.lang.Compiler$CompilerException") - (update-in cause [:message] str/replace - #".* (compiling:)\((.*)\)" "Error $1 $2") + (let [re #".* (compiling:)\(([^:]*):(\d+):(\d+)\)" + [_ label source line column] (re-matches re (:message cause))] + (assoc (update-in cause [:message] str/replace re + (str "Error " label " " source " line " line " col " column)) + :source source + :line line + :column column)) cause)) ;; CLJS REPLs use :repl-env to store huge amounts of analyzer/compiler state