29
29
(require 'cider-interaction )
30
30
(require 'dash )
31
31
32
+
33
+ ; ;; Customization
34
+ (defgroup cider-debug nil
35
+ " Presentation and behaviour of the cider debugger."
36
+ :prefix " cider-debug-"
37
+ :package-version '(cider-debug . " 0.10.0" ))
38
+
32
39
(defface cider-result-overlay-face
33
40
'((((class color ) (background light )) :foreground " firebrick" )
34
41
(((class color ) (background dark )) :foreground " orange red" ))
35
42
" Face used to display result of debug step at point."
36
- :group 'cider
43
+ :group 'cider-debug
37
44
:package-version " 0.9.1" )
38
45
39
46
(defface cider-debug-code-overlay-face
40
47
'((((class color ) (background light )) :background " grey80" )
41
48
(((class color ) (background dark )) :background " grey30" ))
42
49
" Face used to mark code being debugged."
43
- :group 'cider
50
+ :group 'cider-debug
44
51
:package-version " 0.9.1" )
45
52
46
53
(defface cider-debug-prompt-face
47
54
'((t :underline t :inherit font-lock-builtin-face ))
48
55
" Face used to mark code being debugged."
49
- :group 'cider
56
+ :group 'cider-debug
50
57
:package-version " 0.10.0" )
51
58
52
59
(defcustom cider-debug-use-overlays 'end-of-line
@@ -57,7 +64,7 @@ Possible values are inline, end-of-line, or nil."
57
64
:type '(choice (const :tag " End of line" end-of-line)
58
65
(const :tag " Inline" inline)
59
66
(const :tag " No overlays" nil ))
60
- :group 'cider
67
+ :group 'cider-debug
61
68
:package-version " 0.9.1" )
62
69
63
70
@@ -103,7 +110,7 @@ is displayed at point."
103
110
#'cider--make-overlay
104
111
(line-beginning-position )
105
112
(if (eq where 'inline ) (point ) (line-end-position ))
106
- 'debug-result
113
+ type
107
114
'after-string
108
115
(propertize (concat (propertize " " 'cursor 1000 )
109
116
cider-interactive-eval-result-prefix
@@ -126,7 +133,7 @@ is displayed at point."
126
133
(cider--make-result-overlay value 'debug-result cider-debug-use-overlays
127
134
'before-string cider--fringe-arrow-string)
128
135
; ; Code
129
- (cider--make-overlay (save-excursion (forward- sexp - 1 ) (point ))
136
+ (cider--make-overlay (save-excursion (clojure-backward-logical- sexp 1 ) (point ))
130
137
(point ) 'debug-code
131
138
'face 'cider-debug-code-overlay-face
132
139
; ; Higher priority than `show-paren' .
@@ -146,7 +153,7 @@ Set by `cider--turn-on-debug-mode'.")
146
153
" If non-nil, local variables are displayed while debugging.
147
154
Can be toggled at any time with `\\[cider-debug-toggle-locals]' ."
148
155
:type 'boolean
149
- :group 'cider
156
+ :group 'cider-debug
150
157
:package-version '(cider . " 0.10.0" ))
151
158
152
159
(defun cider--debug-format-locals-list (locals )
@@ -274,20 +281,6 @@ ID is the id of the message that instrumented CODE."
274
281
(set-buffer-modified-p nil ))))
275
282
(switch-to-buffer buffer-name)))
276
283
277
- (defun cider--forward-sexp (n )
278
- " Move forward N logical sexps.
279
- This will skip over sexps that don't represent objects, such as ^hints and
280
- #reader.macros."
281
- (while (> n 0 )
282
- ; ; Non-logical sexps.
283
- (while (progn (forward-sexp 1 )
284
- (forward-sexp -1 )
285
- (looking-at-p " \\ ^\\ |#[[:alpha:]]" ))
286
- (forward-sexp 1 ))
287
- ; ; The actual sexp
288
- (forward-sexp 1 )
289
- (setq n (1- n))))
290
-
291
284
(defun cider--debug-goto-keyval (key )
292
285
" Find KEY in current sexp or return nil."
293
286
(-when-let (limit (ignore-errors (save-excursion (up-list ) (point ))))
@@ -311,12 +304,12 @@ sexp."
311
304
; ; String coordinates are map keys.
312
305
(if (stringp next)
313
306
(cider--debug-goto-keyval next)
314
- (cider-- forward-sexp next )))
307
+ (clojure- forward-logical- sexp ( pop coordinates) )))
315
308
; ; If that extra pop was the last coordinate, this represents the
316
309
; ; entire #(...), so we should move back out.
317
310
(backward-up-list )))
318
311
; ; Place point at the end of instrumented sexp.
319
- (cider-- forward-sexp 1 ))
312
+ (clojure- forward-logical -sexp 1 ))
320
313
; ; Avoid throwing actual errors, since this happens on every breakpoint.
321
314
(error (message " Can't find instrumented sexp, did you edit the source? " ))))
322
315
0 commit comments