# Simulate disk-based diagnostics finishing 1s after saving buffer · gitcafe/zed

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

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

Visibility: public

Requested revision: baee6d03425ee8bfe3f78b1b8e0b2b65ad697b3d

Requested commit: baee6d03425ee8bfe3f78b1b8e0b2b65ad697b3d

Commit: baee6d03425ee8bfe3f78b1b8e0b2b65ad697b3d

Tree: 1614fbddd3ef0fba412e0bcc5d47258020b5736f

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Simulate disk-based diagnostics finishing 1s after saving buffer

Previously, we would simulate disk-based diagnostics finishing after
saving a buffer. However, the language server may produce diagnostics
right after emitting the event, causing the diagnostics status bar item
to not reflect the latest state of the buffer.

With this change, we will instead simulate disk-based diagnostics finishing
after 1s after saving the buffer (only for language servers that
don't have the concept of disk-based diagnostics, such as TypeScript). This
ensures we always reflect the latest state and doesn't cause the UI to flicker
as a result of the LSP sending us diagnostics after every input.

```

## Parents

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

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