File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 9090 Sends `$/cancelRequest` only once, though `lsp4clj.server/deref-or-cancel` or
9191 `future-cancel` can be called multiple times."
9292 [id method started server]
93- ; ; Chaining `(-> (p/deferred) (p/catch ...))` seems like it should work, but
94- ; ; doesn't.
9593 (let [p (p/deferred )]
96- ; ; side-effect of cancellation:
94+ ; ; Set up a side-effect so that when the Request is cancelled, we inform the
95+ ; ; client. This cannot be `(-> (p/deferred) (p/catch))` because that returns
96+ ; ; a promise which, when cancelled, does nothing because there's no
97+ ; ; exception handler chained onto it. Instead, we must cancel the
98+ ; ; `(p/deffered)` promise itself.
9799 (p/catch p CancellationException
98100 (fn [_]
99101 (protocols.endpoint/send-notification server " $/cancelRequest" {:id id})))
You can’t perform that action at this time.
0 commit comments