File tree 2 files changed +14
-7
lines changed
src/cider/nrepl/middleware
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -627,7 +627,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
627
627
(defn breakpoint-reader
628
628
" #break reader. Mark `form` for breakpointing."
629
629
[form]
630
- (ins/tag-form form #'breakpoint-with-initial-debug-bindings))
630
+ (ins/tag-form form #'breakpoint-with-initial-debug-bindings true ))
631
631
632
632
(defn debug-reader
633
633
" #dbg reader. Mark all forms in `form` for breakpointing.
@@ -639,7 +639,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
639
639
(defn break-on-exception-reader
640
640
" #exn reader. Wrap `form` in try-catch and break only on exception"
641
641
[form]
642
- (ins/tag-form form #'breakpoint-if-exception-with-initial-debug-bindings))
642
+ (ins/tag-form form #'breakpoint-if-exception-with-initial-debug-bindings true ))
643
643
644
644
(defn debug-on-exception-reader
645
645
" #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