# Improve support for multiple registrations of \`textDocument/diagnostic\` \(\#43703\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a51e975b817336d5eaa13e549bbcf9f1194ec1a6

Requested commit: a51e975b817336d5eaa13e549bbcf9f1194ec1a6

Commit: a51e975b817336d5eaa13e549bbcf9f1194ec1a6

Tree: 07c55104b42a987097e905ca7d10172f6ac2af7c

Author: John Tur

Committer: GitHub

## Message

```
Improve support for multiple registrations of  `textDocument/diagnostic` (#43703)

Closes https://github.com/zed-industries/zed/issues/41935

The registration ID responsible for generating each diagnostic is now
tracked. This allows us to replace only the diagnostics from the same
registration ID when a pull diagnostics report is applied.

Additionally, various deficiencies in our support for pull diagnostics
have been fixed:
- Document pulls are issued for all open buffers, not just the edited
one. A shorter debounce is used for the edited buffer. Workspace
diagnostics are also now ignored for open buffers.
- Tracking of `lastResultId` is improved.
- Stored pull diagnostics are discarded when the corresponding buffer is
closed.

Release Notes:

- Improved compatibility with language servers that use the "pull
diagnostics" feature of Language Server Protocol.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

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

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