# lsp: Refresh \`textDocument/diagnostic\` on \`workspace/diagnostic/refresh\` \(\#45365\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3387021dff991ae097daf90ece3d86e7da9e8638

Requested commit: 3387021dff991ae097daf90ece3d86e7da9e8638

Commit: 3387021dff991ae097daf90ece3d86e7da9e8638

Tree: 45e6ded35f2ee5f6bc5a6112b7c66ac66ffae348

Author: Shuhei Kadowaki

Committer: GitHub

## Message

```
lsp: Refresh `textDocument/diagnostic` on `workspace/diagnostic/refresh` (#45365)

Per LSP spec, when receiving `workspace/diagnostic/refresh`, clients
should refresh all pulled diagnostics including both workspace and
document diagnostics[^1]. Previously, only workspace diagnostics were
refreshed.

[^1]:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#diagnostic_refresh

This adds `pull_document_diagnostics_for_server()`, which refreshes
`textDocument/diagnostic` for all open buffers associated with the
given language server.

Closes #ISSUE

Release Notes:

- When handling `workspace/diagnostic/refresh`, Zed now also sends new
`textDocument/diagnostic` requests for open files, aligning with the LSP
specification.

---------

Co-authored-by: John Tur <john-tur@outlook.com>
```

## Parents

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

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