@@ -91,6 +91,12 @@ by clicking or navigating to them by other means."
91
91
:type 'boolean
92
92
:package-version '(cider . " 0.27.0" ))
93
93
94
+ (defcustom cider-inspector-display-analytics-hint t
95
+ " When true, display hint about analytics feature for eligible objects.
96
+ Can be turned to nil once the user sees and acknowledges the feature."
97
+ :type 'boolean
98
+ :package-version '(cider . " 1.18.0" ))
99
+
94
100
(defvar cider-inspector-uninteresting-regexp
95
101
(concat " nil" ; nils are not interesting
96
102
" \\ |:" clojure--sym-regexp ; nor keywords
@@ -125,6 +131,7 @@ by clicking or navigating to them by other means."
125
131
(define-key map " c" #'cider-inspector-set-max-coll-size )
126
132
(define-key map " C" #'cider-inspector-set-max-nested-depth )
127
133
(define-key map " v" #'cider-inspector-toggle-view-mode )
134
+ (define-key map " y" #'cider-inspector-display-analytics )
128
135
(define-key map " d" #'cider-inspector-def-current-val )
129
136
(define-key map " t" #'cider-inspector-tap-current-val )
130
137
(define-key map " 1" #'cider-inspector-tap-at-point )
@@ -325,6 +332,17 @@ MAX-NESTED-DEPTH is the new value."
325
332
(interactive (list (read-number " Max nested depth: " cider-inspector-max-nested-depth)))
326
333
(cider-inspector--refresh-with-opts " max-nested-depth" max-nested-depth))
327
334
335
+ (defun cider-inspector-display-analytics ()
336
+ " Toggle the display of analytics for the inspected object."
337
+ (interactive )
338
+ ; ; Disable hint about analytics feature so that it is never displayed again.
339
+ (when cider-inspector-display-analytics-hint
340
+ (customize-set-variable 'cider-inspector-display-analytics-hint nil ))
341
+ (let ((result (cider-nrepl-send-sync-request `(" op" " inspect-display-analytics" )
342
+ (cider-current-repl))))
343
+ (when (nrepl-dict-get result " value" )
344
+ (cider-inspector--render-value result :next-inspectable ))))
345
+
328
346
(defun cider-inspector-toggle-view-mode ()
329
347
" Toggle the view mode of the inspector between normal and object view mode."
330
348
(interactive )
@@ -490,7 +508,9 @@ MAX-COLL-SIZE if non nil."
490
508
,@(when cider-inspector-max-coll-size
491
509
`(" max-coll-size" , cider-inspector-max-coll-size ))
492
510
,@(when cider-inspector-max-nested-depth
493
- `(" max-nested-depth" , cider-inspector-max-nested-depth ))))
511
+ `(" max-nested-depth" , cider-inspector-max-nested-depth ))
512
+ ,@(when cider-inspector-display-analytics-hint
513
+ `(" display-analytics-hint" " true" ))))
494
514
(cider-nrepl-send-sync-request (cider-current-repl))))
495
515
496
516
(declare-function cider-set-buffer-ns " cider-mode" )
0 commit comments