ZIm/crates/project/src
Kirill Bulatov 9999c31859
Avoid endless loop of the diagnostic updates (#21209)
Follow-up of https://github.com/zed-industries/zed/pull/21173

Rust-analyzer with `checkOnSave` enabled will push diagnostics for a
file after each diagnostics refresh (e.g. save, file open, file close).

If there's a file that is not open in any pane and has only warnings,
and the diagnostics editor has warnings toggled off, then

0. rust-analyzer will push the corresponding warnings after initial load
1. the diagnostics editor code registers
`project::Event::DiagnosticsUpdated` for the corresponding file path and
opens the corresponding buffer to read its associated diagnostics from
the snapshot
2. opening the buffer would send `textDocument/didOpen` which would
trigger rust-analyzer to push the same diagnostics
3. meanwhile, the diagnostics editor would filter out all diagnostics
for that buffer, dropping the open buffer and effectively closing it
4. closing the buffer will send `textDocument/didClose` which would
trigger rust-analyzer to push the same diagnostics again, as those are
`cargo check` ones, still present in the file
5. GOTO 1

Release Notes:

- Fixed diagnostics editor not scrolling properly under certain
conditions
2024-11-26 14:29:54 +02:00
..
lsp_command use ssh lsp store (#17655) 2024-09-10 15:51:01 -04:00
buffer_store.rs Simplify BufferStore's local vs remote state (#21180) 2024-11-25 12:53:23 -08:00
color_extractor.rs Show color swatches for LSP completions (#18665) 2024-10-03 14:38:17 -04:00
connection_manager.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
debounced_delay.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
direnv.rs Environment loading fixes (#19144) 2024-10-16 12:14:40 +02:00
environment.rs environment: Log stderr too if command fails to run (#20659) 2024-11-14 14:44:32 +01:00
image_store.rs Add File.disk_state enum to clarify filesystem states (#20776) 2024-11-18 10:30:08 -08:00
lsp_command.rs Properly use lsp::CompletionList defaults (#21202) 2024-11-26 12:23:38 +02:00
lsp_ext_command.rs lsp: Retrieve links to documentation for the given symbol (#19233) 2024-11-16 20:23:49 +02:00
lsp_store.rs Avoid endless loop of the diagnostic updates (#21209) 2024-11-26 14:29:54 +02:00
prettier_store.rs language servers: Fix wrong language server name (#20428) 2024-11-11 10:18:38 +01:00
project.rs Filter LSP code actions based on the requested kinds (#20847) 2024-11-22 13:01:00 +01:00
project_settings.rs language servers: Fix wrong language server name (#20428) 2024-11-11 10:18:38 +01:00
project_tests.rs Filter LSP code actions based on the requested kinds (#20847) 2024-11-22 13:01:00 +01:00
search.rs Enable look-around in Project Search using fancy-regex crate (#20308) 2024-11-07 09:18:09 -07:00
search_history.rs project search: Persist search history across session (#9932) 2024-04-02 11:13:18 +02:00
task_inventory.rs tasks: Add ability to query active toolchains for languages (#20667) 2024-11-14 14:37:37 +01:00
task_store.rs tasks: Add ability to query active toolchains for languages (#20667) 2024-11-14 14:37:37 +01:00
terminals.rs Add the option to hide both the task and command lines in the task output (#20920) 2024-11-22 13:45:42 -05:00
toolchain_store.rs toolchains: Expose raw JSON representation of a toolchain (#20721) 2024-11-21 13:27:25 +01:00
worktree_store.rs Don't try to make project search and outline order match project panel (#20513) 2024-11-11 12:20:04 -08:00
yarn.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00