# Cancel language server requests if request is dropped · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1a6cd7333429d0b102eaaa30ff96841ed46569b7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1a6cd7333429d0b102eaaa30ff96841ed46569b7

Requested commit: 1a6cd7333429d0b102eaaa30ff96841ed46569b7

Commit: 1a6cd7333429d0b102eaaa30ff96841ed46569b7

Tree: a6fc4527744375b2a075528e89e18a56ada07a09

Author: Thorsten Ball

Committer: Thorsten Ball

## Message

```
Cancel language server requests if request is dropped

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.

```

## Parents

- [338dcd76b1d67468e95e54e219363c4b4b8e8340](https://git.cafe/gitcafe/zed/commit/338dcd76b1d67468e95e54e219363c4b4b8e8340?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1a6cd7333429d0b102eaaa30ff96841ed46569b7?format=markdown)
