@@ -118,6 +118,27 @@ namespace-qualified function of zero arity."
118
118
:group 'cider
119
119
:package-version '(cider . " 0.10.0" ))
120
120
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
+
121
142
(defun cider-ns-refresh--handle-response (response log-buffer )
122
143
" Refresh LOG-BUFFER with RESPONSE."
123
144
(nrepl-dbind-response response (out err reloading status error error-ns after before)
@@ -168,8 +189,9 @@ namespace-qualified function of zero arity."
168
189
(with-current-buffer cider-ns-refresh-log-buffer
169
190
(goto-char (point-max ))))
170
191
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 ))))
173
195
174
196
(defun cider-ns-refresh--save-modified-buffers ()
175
197
" Ensure any relevant modified buffers are saved before refreshing.
@@ -219,10 +241,11 @@ indirectly load via require\"."
219
241
220
242
;;;### autoload
221
243
(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).
223
246
224
247
With 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.
226
249
227
250
With a double prefix argument, or if MODE is `clear' , clear the state of
228
251
the namespace tracker before reloading. This is useful for recovering from
0 commit comments