@@ -294,13 +294,19 @@ See `cider-sync-request:inspect-next-sibling' and `cider-inspector--render-value
294
294
(cider-inspector--render-value result 'v2 )
295
295
(cider-inspector-next-inspectable-object 1 ))))
296
296
297
+ (defun cider-inspector--refresh-with-opts (&rest opts )
298
+ " Invokes `inspect-refresh' op with supplied extra OPTS.
299
+ Re-renders the currently inspected value."
300
+ (let ((result (cider-nrepl-send-sync-request `(" op" " inspect-refresh" ,@opts )
301
+ cider-inspector--current-repl)))
302
+ (when (nrepl-dict-get result " value" )
303
+ (cider-inspector--render-value result 'v2 ))))
304
+
297
305
(defun cider-inspector-refresh ()
298
306
" Re-render the currently inspected value.
299
307
See `cider-sync-request:inspect-refresh' and `cider-inspector--render-value' "
300
308
(interactive )
301
- (let ((result (cider-sync-request:inspect-refresh 'v2 )))
302
- (when (nrepl-dict-get result " value" )
303
- (cider-inspector--render-value result 'v2 ))))
309
+ (cider-inspector--refresh-with-opts))
304
310
305
311
(defun cider-inspector-next-page ()
306
312
" Jump to the next page when inspecting a paginated sequence/map.
@@ -327,32 +333,24 @@ Does nothing if already on the first page."
327
333
328
334
Current page will be reset to zero."
329
335
(interactive (list (read-number " Page size: " cider-inspector-page-size)))
330
- (let ((result (cider-sync-request:inspect-set-page-size page-size 'v2 )))
331
- (when (nrepl-dict-get result " value" )
332
- (cider-inspector--render-value result 'v2 ))))
336
+ (cider-inspector--refresh-with-opts " page-size" page-size))
333
337
334
338
(defun cider-inspector-set-max-atom-length (max-length )
335
339
" Set the max length of nested atoms to MAX-LENGTH."
336
340
(interactive (list (read-number " Max atom length: " cider-inspector-max-atom-length)))
337
- (let ((result (cider-sync-request:inspect-set-max-atom-length max-length 'v2 )))
338
- (when (nrepl-dict-get result " value" )
339
- (cider-inspector--render-value result 'v2 ))))
341
+ (cider-inspector--refresh-with-opts " max-atom-length" max-length))
340
342
341
343
(defun cider-inspector-set-max-coll-size (max-size )
342
344
" Set the number of nested collection members to display before truncating.
343
345
MAX-SIZE is the new value."
344
346
(interactive (list (read-number " Max collection size: " cider-inspector-max-coll-size)))
345
- (let ((result (cider-sync-request:inspect-set-max-coll-size max-size 'v2 )))
346
- (when (nrepl-dict-get result " value" )
347
- (cider-inspector--render-value result 'v2 ))))
347
+ (cider-inspector--refresh-with-opts " max-coll-size" max-size))
348
348
349
349
(defun cider-inspector-set-max-nested-depth (max-nested-depth )
350
350
" Set the level of nesting for collections to display beflore truncating.
351
351
MAX-NESTED-DEPTH is the new value."
352
352
(interactive (list (read-number " Max nested depth: " cider-inspector-max-nested-depth)))
353
- (let ((result (cider-sync-request:inspect-set-max-nested-depth max-nested-depth 'v2 )))
354
- (when (nrepl-dict-get result " value" )
355
- (cider-inspector--render-value result 'v2 ))))
353
+ (cider-inspector--refresh-with-opts " max-nested-depth" max-nested-depth))
356
354
357
355
(defun cider-inspector-toggle-view-mode ()
358
356
" Toggle the view mode of the inspector between normal and object view mode."
@@ -515,6 +513,7 @@ instead of just its \"value\" entry."
515
513
" Set the page size in paginated view to PAGE-SIZE,
516
514
V2 indicates if the entire response should be returned
517
515
instead of just its \" value\" entry."
516
+ (declare (obsolete " use `inspect-refresh' op instead." " 1.15.0" ))
518
517
(let ((result (thread-first `(" op" " inspect-set-page-size"
519
518
" page-size" , page-size )
520
519
(cider-nrepl-send-sync-request cider-inspector--current-repl))))
@@ -526,6 +525,7 @@ instead of just its \"value\" entry."
526
525
" Set the max length of nested atoms to MAX-LENGTH,
527
526
V2 indicates if the entire response should be returned
528
527
instead of just its \" value\" entry."
528
+ (declare (obsolete " use `inspect-refresh' op instead." " 1.15.0" ))
529
529
(let ((result (thread-first `(" op" " inspect-set-max-atom-length"
530
530
" max-atom-length" , max-length )
531
531
(cider-nrepl-send-sync-request cider-inspector--current-repl))))
@@ -537,6 +537,7 @@ instead of just its \"value\" entry."
537
537
" Set the number of nested collection members to display before truncating.
538
538
MAX-SIZE is the new value, V2 indicates if the entire response should be returned
539
539
instead of just its \" value\" entry."
540
+ (declare (obsolete " use `inspect-refresh' op instead." " 1.15.0" ))
540
541
(let ((result (thread-first `(" op" " inspect-set-max-coll-size"
541
542
" max-coll-size" , max-size )
542
543
(cider-nrepl-send-sync-request cider-inspector--current-repl))))
@@ -548,6 +549,7 @@ instead of just its \"value\" entry."
548
549
" Set the level of nesting for collections to display before truncating.
549
550
MAX-NESTED-DEPTH is the new value, V2 indicates if the entire response should be returned
550
551
instead of just its \" value\" entry."
552
+ (declare (obsolete " use `inspect-refresh' op instead." " 1.15.0" ))
551
553
(let ((result (thread-first `(" op" " inspect-set-max-nested-depth"
552
554
" max-nested-depth" , max-nested-depth )
553
555
(cider-nrepl-send-sync-request cider-inspector--current-repl))))
0 commit comments