SIGN IN SIGN UP

Cancel language server requests if request is dropped (#4159)

Before this change, we would send requests to language servers without
canceling them even if we never wait for their response.

Example: when doing document highlights, we'd send a request (modulo
debouncing) whenever a change was made, ignoring previously sent
requests that might still be in-flight.

With this change, we now send a Cancel request (from the LSP spec) to
the language server in case no one listens to the response anymore
(which is what happens when the `Future` returned by `request_internal`)
is dropped.

Release Notes:

- Improved performance when interacting with language servers.
T
Thorsten Ball committed
e55e895e1935f624f5ea1c1a07e1c30366e5487d
Committed by GitHub <noreply@github.com> on 1/19/2024, 3:54:24 PM