Skip to content

editor: Don't bypass show_edit_predictions when navigating diagnostics - #56055

Merged
osyvokon merged 2 commits into
zed-industries:mainfrom
aviatesk:avi/fix-diagnostic-definition-requests
Jun 5, 2026
Merged

editor: Don't bypass show_edit_predictions when navigating diagnostics#56055
osyvokon merged 2 commits into
zed-industries:mainfrom
aviatesk:avi/fix-diagnostic-definition-requests

Conversation

@aviatesk

@aviatesk aviatesk commented May 7, 2026

Copy link
Copy Markdown
Collaborator

go_to_diagnostic_impl was calling refresh_edit_prediction(false, true) with user_requested = true, which skips the should_show_edit_predictions check inside refresh_edit_prediction (crates/editor/src/editor.rs).

As a result, navigating between diagnostics in a buffer where the user has set show_edit_predictions: false would still trigger EditPredictionProvider::refresh. With the Zed provider this fans out into many textDocument/definition and textDocument/typeDefinition LSP requests for every identifier near the cursor (RelatedExcerptStore::fetch_excerpts), which is surprising for users who have explicitly disabled edit predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an edit prediction, so pass user_requested = false and enable debouncing here.

Release Notes:

  • Fixed diagnostic navigation triggering unnecessary LSP requests when edit predictions are disabled.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 7, 2026
@aviatesk
aviatesk force-pushed the avi/fix-diagnostic-definition-requests branch from bc3ec9b to 8bcf1dc Compare May 7, 2026 14:00
@ChristopherBiscardi ChristopherBiscardi added area:editor Feedback for code editing, formatting, editor iterations, etc area:ai/edit prediction Umbrella label for Copilot, Supermaven, etc. inline completions (non-Zeta-specific) labels May 7, 2026
@aviatesk
aviatesk force-pushed the avi/fix-diagnostic-definition-requests branch from 8bcf1dc to 4ffba50 Compare May 12, 2026 04:31
@aviatesk

Copy link
Copy Markdown
Collaborator Author

@osyvokon Could you take a look when you get a chance? This corrects the user_requested flag at the refresh_edit_prediction call site in go_to_diagnostic_impl — the semantics you introduced in 663e181.

@osyvokon osyvokon self-assigned this May 12, 2026
@aviatesk
aviatesk force-pushed the avi/fix-diagnostic-definition-requests branch from 4ffba50 to 7863bd5 Compare May 29, 2026 02:16
`go_to_diagnostic_impl` was calling `refresh_edit_prediction(false, true)`
with `user_requested = true`, which skips the `should_show_edit_predictions`
check in `refresh_edit_prediction`. As a result, navigating between
diagnostics in a buffer where the user has set `show_edit_predictions: false`
would still trigger the edit prediction provider's `refresh`. With the Zed
provider this fans out into many `textDocument/definition` and
`textDocument/typeDefinition` LSP requests for every identifier near the
cursor, which is surprising for users who have explicitly disabled edit
predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an edit
prediction, so pass `user_requested = false` (and enable debouncing) here.

Release Notes:

- Fixed edit prediction context being refreshed when navigating between
  diagnostics in buffers where edit predictions are disabled, which could
  trigger many LSP definition requests
@aviatesk
aviatesk force-pushed the avi/fix-diagnostic-definition-requests branch from 7863bd5 to fc740a1 Compare June 5, 2026 01:16
@aviatesk

aviatesk commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Bump.

@osyvokon osyvokon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@osyvokon
osyvokon enabled auto-merge June 5, 2026 08:44
@osyvokon
osyvokon added this pull request to the merge queue Jun 5, 2026
Merged via the queue into zed-industries:main with commit b93d14e Jun 5, 2026
33 checks passed
@aviatesk
aviatesk deleted the avi/fix-diagnostic-definition-requests branch June 5, 2026 10:01
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
zed-industries#56055)

`go_to_diagnostic_impl` was calling `refresh_edit_prediction(false,
true)` with `user_requested = true`, which skips the
`should_show_edit_predictions` check inside `refresh_edit_prediction`
(`crates/editor/src/editor.rs`).

As a result, navigating between diagnostics in a buffer where the user
has set `show_edit_predictions: false` would still trigger
`EditPredictionProvider::refresh`. With the Zed provider this fans out
into many `textDocument/definition` and `textDocument/typeDefinition`
LSP requests for every identifier near the cursor
(`RelatedExcerptStore::fetch_excerpts`), which is surprising for users
who have explicitly disabled edit predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an
edit prediction, so pass `user_requested = false` and enable debouncing
here.

Release Notes:

- Fixed diagnostic navigation triggering unnecessary LSP requests when
edit predictions are disabled.

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
zed-industries#56055)

`go_to_diagnostic_impl` was calling `refresh_edit_prediction(false,
true)` with `user_requested = true`, which skips the
`should_show_edit_predictions` check inside `refresh_edit_prediction`
(`crates/editor/src/editor.rs`).

As a result, navigating between diagnostics in a buffer where the user
has set `show_edit_predictions: false` would still trigger
`EditPredictionProvider::refresh`. With the Zed provider this fans out
into many `textDocument/definition` and `textDocument/typeDefinition`
LSP requests for every identifier near the cursor
(`RelatedExcerptStore::fetch_excerpts`), which is surprising for users
who have explicitly disabled edit predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an
edit prediction, so pass `user_requested = false` and enable debouncing
here.

Release Notes:

- Fixed diagnostic navigation triggering unnecessary LSP requests when
edit predictions are disabled.

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
zed-industries#56055)

`go_to_diagnostic_impl` was calling `refresh_edit_prediction(false,
true)` with `user_requested = true`, which skips the
`should_show_edit_predictions` check inside `refresh_edit_prediction`
(`crates/editor/src/editor.rs`).

As a result, navigating between diagnostics in a buffer where the user
has set `show_edit_predictions: false` would still trigger
`EditPredictionProvider::refresh`. With the Zed provider this fans out
into many `textDocument/definition` and `textDocument/typeDefinition`
LSP requests for every identifier near the cursor
(`RelatedExcerptStore::fetch_excerpts`), which is surprising for users
who have explicitly disabled edit predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an
edit prediction, so pass `user_requested = false` and enable debouncing
here.

Release Notes:

- Fixed diagnostic navigation triggering unnecessary LSP requests when
edit predictions are disabled.

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai/edit prediction Umbrella label for Copilot, Supermaven, etc. inline completions (non-Zeta-specific) area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants