@@ -118,6 +118,27 @@ namespace-qualified function of zero arity."
118118 :group 'cider
119119 :package-version '(cider . " 0.10.0" ))
120120
121+ (defun cider-ns--present-error (error )
122+ " Render the `ERROR' stacktrace,
123+ and jump to the adequate file/line location."
124+ (let* ((buf)
125+ (jump-args (seq-some (lambda (cause-dict ) ; ; a dict representing an exception cause
126+ (nrepl-dbind-response cause-dict (file-url line column)
127+ (when (and file-url
128+ ; ; jars are unlikely sources of user errors, so we favor the next `cause-dict' :
129+ (not (string-prefix-p " jar:" file-url))
130+ line)
131+ (setq buf (cider--find-buffer-for-file file-url))
132+ (list buf (cons line column)))))
133+ error )))
134+ (when jump-args
135+ (apply #'cider-jump-to jump-args))
136+ (cider--render-stacktrace-causes error )
137+ ; ; Select the window displaying the 'culprit' buffer so that the user can immediately fix it,
138+ ; ; as most times the displayed stacktrace doesn't need much inspection:
139+ (when buf
140+ (select-window (get-buffer-window buf)))))
141+
121142(defun cider-ns-refresh--handle-response (response log-buffer )
122143 " Refresh LOG-BUFFER with RESPONSE."
123144 (nrepl-dbind-response response (out err reloading status error error-ns after before)
@@ -168,8 +189,9 @@ namespace-qualified function of zero arity."
168189 (with-current-buffer cider-ns-refresh-log-buffer
169190 (goto-char (point-max ))))
170191
171- (when (member " error" status)
172- (cider--render-stacktrace-causes error ))))
192+ (when (and (member " error" status)
193+ error )
194+ (cider-ns--present-error error ))))
173195
174196(defun cider-ns-refresh--save-modified-buffers ()
175197 " Ensure any relevant modified buffers are saved before refreshing.
@@ -219,10 +241,11 @@ indirectly load via require\"."
219241
220242;;;### autoload
221243(defun cider-ns-refresh (&optional mode )
222- " Reload modified and unloaded namespaces on the classpath.
244+ " Reload modified and unloaded namespaces, using the Reloaded Workflow.
245+ Uses the configured 'refresh dirs' \( defaults to the classpath dirs).
223246
224247With a single prefix argument, or if MODE is `refresh-all' , reload all
225- namespaces on the classpath unconditionally.
248+ namespaces on the classpath dirs unconditionally.
226249
227250With a double prefix argument, or if MODE is `clear' , clear the state of
228251the namespace tracker before reloading. This is useful for recovering from
0 commit comments