Skip to content

Improve support for multiple registrations of textDocument/diagnostic#43703

Merged
SomeoneToIgnore merged 22 commits intomainfrom
pull-diagnostics-registrations
Dec 3, 2025
Merged

Improve support for multiple registrations of textDocument/diagnostic#43703
SomeoneToIgnore merged 22 commits intomainfrom
pull-diagnostics-registrations

Conversation

@reflectronic
Copy link
Member

@reflectronic reflectronic commented Nov 28, 2025

Closes #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.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 28, 2025
@SomeoneToIgnore SomeoneToIgnore merged commit a51e975 into main Dec 3, 2025
23 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the pull-diagnostics-registrations branch December 3, 2025 18:47
baldwindavid added a commit to baldwindavid/zed that referenced this pull request Dec 4, 2025
* main: (155 commits)
  Add support for git remotes (zed-industries#42819)
  python: Improve sorting order of toolchains to give higher precedence to project-local virtual environments that are within current subproject (zed-industries#44141)
  Use buffer language when formatting with Prettier (zed-industries#43368)
  search: Fix sort order not being maintained in presence of open buffers (zed-industries#44135)
  bedrock: Support global endpoints and new regional endpoints (zed-industries#44103)
  linux: Spawn at least two background threads (zed-industries#44110)
  macos: Add missing file access entitlements (zed-industries#43609)
  Re-colorize the brackets when the theme changes (zed-industries#44130)
  Reduce priority of Windows thread pool work items (zed-industries#44121)
  Update fancy-regex (zed-industries#44120)
  Prefer to disable options over hiding (git panel entry context menu) (zed-industries#44102)
  tab_switcher: Subscribe to workspace events instead of pane events (zed-industries#44101)
  editor: Add active match highlight for buffer and project search (zed-industries#44098)
  Add more preview tab settings and fix janky behavior (zed-industries#43921)
  ai: Add an eval for the inline assistant (zed-industries#43291)
  Fix circular reference issue around PopoverMenu again (zed-industries#44084)
  Run `git2::Repository::find_remote` in the background (zed-industries#44092)
  Improve support for multiple registrations of  `textDocument/diagnostic` (zed-industries#43703)
  Revert "http_client: Add integrity checks for GitHub binaries using digest checks (zed-industries#43737)" (zed-industries#44086)
  editor: Fix blame hover not working when inline git blame is disabled (zed-industries#42992)
  ...
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
…c` (zed-industries#43703)

Closes zed-industries#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>
JosephTLyons added a commit that referenced this pull request Dec 16, 2025
…iagnostic` (#43703)"

This reverts commit a51e975.

Co-authored-by: John Tur <john-tur@outlook.com>
someone13574 pushed a commit to someone13574/zed that referenced this pull request Dec 16, 2025
…c` (zed-industries#43703)

Closes zed-industries#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>
reflectronic added a commit that referenced this pull request Jan 5, 2026
#46105)

Additionally, fix a race condition where we'd still insert diagnostics
from a document or workspace pull even if the registration had been
unregistered in the time since the request was issued.

And, as a bonus: when a new pull diagnostics registration is added,
issue document pulls immediately.

This should fix regressions with basedpyright caused by
#43703.

Release Notes:

- N/A
github-actions bot pushed a commit that referenced this pull request Jan 5, 2026
#46105)

Additionally, fix a race condition where we'd still insert diagnostics
from a document or workspace pull even if the registration had been
unregistered in the time since the request was issued.

And, as a bonus: when a new pull diagnostics registration is added,
issue document pulls immediately.

This should fix regressions with basedpyright caused by
#43703.

Release Notes:

- N/A
zed-zippy bot added a commit that referenced this pull request Jan 5, 2026
#46105) (cherry-pick to preview) (#46117)

Cherry-pick of #46105 to preview

----
Additionally, fix a race condition where we'd still insert diagnostics
from a document or workspace pull even if the registration had been
unregistered in the time since the request was issued.

And, as a bonus: when a new pull diagnostics registration is added,
issue document pulls immediately.

This should fix regressions with basedpyright caused by
#43703.

Release Notes:

- N/A

Co-authored-by: John Tur <john-tur@outlook.com>
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
zed-industries#46105)

Additionally, fix a race condition where we'd still insert diagnostics
from a document or workspace pull even if the registration had been
unregistered in the time since the request was issued.

And, as a bonus: when a new pull diagnostics registration is added,
issue document pulls immediately.

This should fix regressions with basedpyright caused by
zed-industries#43703.

Release Notes:

- N/A
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
zed-industries#46105)

Additionally, fix a race condition where we'd still insert diagnostics
from a document or workspace pull even if the registration had been
unregistered in the time since the request was issued.

And, as a bonus: when a new pull diagnostics registration is added,
issue document pulls immediately.

This should fix regressions with basedpyright caused by
zed-industries#43703.

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiagnosticTag.Unnecessary diagnostics not persisted

3 participants