# Stop sending redundant LSP proto requests \(\#35581\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 22473fc6119d41a63714cde9d0139c7a943c7dd8

Requested commit: 22473fc6119d41a63714cde9d0139c7a943c7dd8

Commit: 22473fc6119d41a63714cde9d0139c7a943c7dd8

Tree: a5c7831dbab35d1271173273247d24e06f00d43b

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Stop sending redundant LSP proto requests (#35581)

Before, each time any LSP feature was used on client remote, it always
produced a `proto::` request that always had been sent to the host, from
where returned as an empty response.

Instead, propagate more language server-related data to the client,
`lsp::ServerCapability`, so Zed client can omit certain requests if
those are not supported.

On top of that, rework the approach Zed uses to query for the data
refreshes: before, editors tried to fetch the data when the server start
was reported (locally and remotely).
Now, a later event is selected: on each `textDocument/didOpen` for the
buffer contained in this editor, we will query for new LSP data, reusing
the cache if needed.

Before, servers could reject unregistered files' LSP queries, or process
them slowly when starting up.
Now, such refreshes are happening later and should be cached.

This requires a collab DB change, to restore server data on rejoin.

Release Notes:

- Fixed excessive LSP requests sent during remote sessions
```

## Parents

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

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