File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
src/cider/nrepl/middleware Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -620,7 +620,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
620
620
(defn breakpoint-reader
621
621
" #break reader. Mark `form` for breakpointing."
622
622
[form]
623
- (ins/tag-form form #'breakpoint-with-initial-debug-bindings))
623
+ (ins/tag-form form #'breakpoint-with-initial-debug-bindings true ))
624
624
625
625
(defn debug-reader
626
626
" #dbg reader. Mark all forms in `form` for breakpointing.
@@ -632,7 +632,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
632
632
(defn break-on-exception-reader
633
633
" #exn reader. Wrap `form` in try-catch and break only on exception"
634
634
[form]
635
- (ins/tag-form form #'breakpoint-if-exception-with-initial-debug-bindings))
635
+ (ins/tag-form form #'breakpoint-if-exception-with-initial-debug-bindings true ))
636
636
637
637
(defn debug-on-exception-reader
638
638
" #dbgexn reader. Mark all forms in `form` for breakpointing on exception.
Original file line number Diff line number Diff line change 225
225
; ; Other coll types are safe, so we go inside them and only
226
226
; ; instrument what's interesting.
227
227
; ; Do we also need to check for seq?
228
- coll? (doall (instrument-coll form))
228
+ coll? (cond-> (doall (instrument-coll form))
229
+ (::do-break (meta form)) (with-break ))
229
230
; ; Other things are uninteresting, literals or unreadable objects.
230
- form))
231
+ (cond-> form
232
+ (::do-break (meta form)) (with-break ))))
231
233
232
234
; ;;; ## Pre-instrumentation
233
235
; ;;
294
296
" Tag form to be instrumented with breakfunction.
295
297
This sets the ::breakfunction metadata of form, which can then be
296
298
used by `instrument-tagged-code`. See this function for the meaning
297
- of breakfunction."
298
- [form breakfunction]
299
- (m/merge-meta form {::breakfunction breakfunction}))
299
+ of breakfunction.
300
+ When `do-break?` is true it tells the instrumenter to wrap the form
301
+ with a breakpoint regardless of other heuristics."
302
+ ([form breakfunction]
303
+ (tag-form form breakfunction false ))
304
+ ([form breakfunction do-break?]
305
+ (m/merge-meta form {::breakfunction breakfunction}
306
+ (when do-break? {::do-break true }))))
300
307
301
308
(defn tag-form-recursively
302
309
" Like `tag-form` but also tag all forms inside the given form."
You can’t perform that action at this time.
0 commit comments