Skip to content

Commit adcf3f5

Browse files
committed
Make inspect-print-current-value an async op
I moved the inspect-print-current-value op out of "with-safe-transport" because I saw an exception in the *nrepl-messages* buffer with a "pprint-stacktrace". I believe this is due to inspect-print-current-value sending messages back line by line, which is different from the safe-transport handlers.
1 parent 779f889 commit adcf3f5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/cider/nrepl/middleware/inspect.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
(with-open [writer (print/replying-PrintWriter :value msg msg)]
116116
(binding [*print-length* (or *print-length* 100)
117117
*print-level* (or *print-level* 20)]
118-
((or print-fn pprint/pprint) (:value inspector) writer))
119-
(.flush writer))
118+
((or print-fn pprint/pprint) (:value inspector) writer)
119+
(.flush writer)))
120120
(respond-to msg :status :done)))
121121

122122
(defn tap-current-value [msg]
@@ -126,11 +126,15 @@
126126
(inspector-response msg (swap-inspector! msg inspect/tap-indexed (:idx msg))))
127127

128128
(defn handle-inspect [handler {:keys [op inspect] :as msg}]
129-
(if (and (= op "eval") inspect)
129+
(cond
130+
(and (= op "eval") inspect)
130131
(handle-eval-inspect handler msg)
131132

133+
(and (= op "inspect-print-current-value"))
134+
(print-current-value-reply msg)
135+
136+
:else
132137
(with-safe-transport handler msg
133-
"inspect-print-current-value" print-current-value-reply
134138
"inspect-pop" pop-reply
135139
"inspect-push" push-reply
136140
"inspect-next-sibling" next-sibling-reply

0 commit comments

Comments
 (0)