Skip to content

Commit 27e4830

Browse files
committed
Fix inspector not using the appropriate REPL connection
1 parent fa93545 commit 27e4830

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

cider-inspector.el

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,17 @@ In particular, it does not read `cider-sexp-at-point'."
268268
(defun cider-inspector-pop ()
269269
"Pop the last value off the inspector stack and render it."
270270
(interactive)
271-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-pop"))))
271+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-pop")
272+
(cider-current-repl))))
272273
(when (nrepl-dict-get result "value")
273274
(cider-inspector--render-value result :pop))))
274275

275276
(defun cider-inspector-push (idx)
276277
"Inspect the value at IDX in the inspector stack and render it."
277278
(interactive)
278279
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-push"
279-
"idx" ,idx))))
280+
"idx" ,idx)
281+
(cider-current-repl))))
280282
(when (nrepl-dict-get result "value")
281283
(push (point) cider-inspector-location-stack)
282284
(cider-inspector--render-value result :next-inspectable))))
@@ -290,29 +292,33 @@ If EX-DATA is true, inspect ex-data of the exception instead."
290292
`("op" "inspect-last-exception"
291293
"index" ,index
292294
,@(when ex-data
293-
`("ex-data" "true"))))))
295+
`("ex-data" "true")))
296+
(cider-current-repl))))
294297
(when (nrepl-dict-get result "value")
295298
(setq cider-inspector-location-stack nil)
296299
(cider-inspector--render-value result :next-inspectable))))
297300

298301
(defun cider-inspector-previous-sibling ()
299302
"Inspect the previous sibling value within a sequential parent."
300303
(interactive)
301-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-previous-sibling"))))
304+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-previous-sibling")
305+
(cider-current-repl))))
302306
(when (nrepl-dict-get result "value")
303307
(cider-inspector--render-value result))))
304308

305309
(defun cider-inspector-next-sibling ()
306310
"Inspect the next sibling value within a sequential parent."
307311
(interactive)
308-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-next-sibling"))))
312+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-next-sibling")
313+
(cider-current-repl))))
309314
(when (nrepl-dict-get result "value")
310315
(cider-inspector--render-value result))))
311316

312317
(defun cider-inspector--refresh-with-opts (&rest opts)
313318
"Invokes `inspect-refresh' op with supplied extra OPTS.
314319
Re-renders the currently inspected value."
315-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-refresh" ,@opts))))
320+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-refresh" ,@opts)
321+
(cider-current-repl))))
316322
(when (nrepl-dict-get result "value")
317323
(cider-inspector--render-value result))))
318324

@@ -326,7 +332,8 @@ Re-renders the currently inspected value."
326332
327333
Does nothing if already on the last page."
328334
(interactive)
329-
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-next-page"))))
335+
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-next-page")
336+
(cider-current-repl))))
330337
(when (nrepl-dict-get result "value")
331338
(cider-inspector--render-value result))))
332339

@@ -335,7 +342,8 @@ Does nothing if already on the last page."
335342
336343
Does nothing if already on the first page."
337344
(interactive)
338-
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-prev-page"))))
345+
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-prev-page")
346+
(cider-current-repl))))
339347
(when (nrepl-dict-get result "value")
340348
(cider-inspector--render-value result))))
341349

@@ -369,7 +377,8 @@ MAX-NESTED-DEPTH is the new value."
369377
;; Disable hint about analytics feature so that it is never displayed again.
370378
(when cider-inspector-display-analytics-hint
371379
(customize-set-variable 'cider-inspector-display-analytics-hint nil))
372-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-display-analytics"))))
380+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-display-analytics")
381+
(cider-current-repl))))
373382
(when (nrepl-dict-get result "value")
374383
(cider-inspector--render-value result :next-inspectable))))
375384

@@ -397,7 +406,8 @@ MAX-NESTED-DEPTH is the new value."
397406
(defun cider-inspector-toggle-view-mode ()
398407
"Toggle the view mode of the inspector between normal and object view mode."
399408
(interactive)
400-
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-toggle-view-mode"))))
409+
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-toggle-view-mode")
410+
(cider-current-repl))))
401411
(when (nrepl-dict-get result "value")
402412
(cider-inspector--render-value result :next-inspectable))))
403413

@@ -431,7 +441,8 @@ current-namespace."
431441
ns)))
432442
(when-let* ((result (cider-nrepl-send-sync-request `("op" "inspect-def-current-value"
433443
"ns" ,ns
434-
"var-name" ,var-name))))
444+
"var-name" ,var-name)
445+
(cider-current-repl))))
435446
(cider-inspector--render-value result)
436447
(message "Defined current inspector value as #'%s/%s" ns var-name)))
437448

@@ -449,7 +460,8 @@ current-namespace."
449460
(defun cider-inspector-tap-current-val ()
450461
"Sends the current Inspector current value to `tap>'."
451462
(interactive)
452-
(let ((response (cider-nrepl-send-sync-request '("op" "inspect-tap-current-value"))))
463+
(let ((response (cider-nrepl-send-sync-request '("op" "inspect-tap-current-value")
464+
(cider-current-repl))))
453465
(nrepl-dbind-response response (value err)
454466
(if value
455467
(message "Successfully tapped the current Inspector value")
@@ -463,7 +475,8 @@ current-namespace."
463475
(`cider-value-idx
464476
(cl-assert value)
465477
(nrepl-dbind-response (cider-nrepl-send-sync-request `("op" "inspect-tap-indexed"
466-
"idx" ,value))
478+
"idx" ,value)
479+
(cider-current-repl))
467480
(value err)
468481
(if value
469482
(message "Successfully tapped the Inspector item at point")
@@ -493,7 +506,7 @@ MAX-COLL-SIZE if non nil."
493506
"pretty-print" ,(if cider-inspector-pretty-print "true" "false")
494507
"sort-maps" ,(if cider-inspector-sort-maps "true" "false")
495508
"only-diff" ,(if cider-inspector-only-diff "true" "false")))
496-
(cider-nrepl-send-sync-request)))
509+
(cider-nrepl-send-sync-request (cider-current-repl))))
497510

498511
(declare-function cider-set-buffer-ns "cider-mode")
499512

0 commit comments

Comments
 (0)