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 90
90
Sends `$/cancelRequest` only once, though `lsp4clj.server/deref-or-cancel` or
91
91
`future-cancel` can be called multiple times."
92
92
[id method started server]
93
- ; ; Chaining `(-> (p/deferred) (p/catch ...))` seems like it should work, but
94
- ; ; doesn't.
95
93
(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.
97
99
(p/catch p CancellationException
98
100
(fn [_]
99
101
(protocols.endpoint/send-notification server " $/cancelRequest" {:id id})))
You can’t perform that action at this time.
0 commit comments