mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-15 06:40:17 +00:00
7288be4251
When editing rust code, the project diagnostics view sometimes fails to
update, so that you have to close the view and re-open it to see the
correct state.
This PR fixes one possible cause of that problem. There was an async
step in between *receiving* diagnostics from the language server and
updating the diagnostics, due to an async call to
`LspAdapter::process_diagnostics`. This could cause the following
sequence of events to happen:
1. Rust-analyzer sends us new diagnostics for a file `a.rs`
2. We call `process_diagnostics` with those diagnostics
3. Rust-analyzer sends us a `WorkDoneProgress` message, indicating that
the "flycheck" (aka `cargo check`) process has completed
4. We update the project diagnostics view due to this message.
5. The `process_diagnostics` call for `a.rs` completes
6. 💥 We have the new diagnostics for `a.rs`, but do not update the
project diagnostics view again.
This PR fixes this bug by simply making `process_diagnostics`
synchronous. There is no I/O or expensive computation happening in that
method. If we need to make it asynchronous in the future, we need to
introduce a queue that ensures that `publishDiagnostics` and
`workDoneProgress` messages are processed serially.
Release Notes:
- Fixed a bug where the project diagnostics view would sometimes fail to
update properly when using Rust-analyzer.
|
||
---|---|---|
.. | ||
activity_indicator | ||
ai | ||
audio | ||
auto_update | ||
breadcrumbs | ||
call | ||
cli | ||
client | ||
clock | ||
collab | ||
collab_ui | ||
collections | ||
command_palette | ||
context_menu | ||
copilot | ||
copilot_button | ||
db | ||
diagnostics | ||
drag_and_drop | ||
editor | ||
feedback | ||
file_finder | ||
fs | ||
fsevent | ||
fuzzy | ||
git | ||
go_to_line | ||
gpui | ||
gpui_macros | ||
install_cli | ||
journal | ||
language | ||
language_selector | ||
language_tools | ||
live_kit_client | ||
live_kit_server | ||
lsp | ||
media | ||
menu | ||
node_runtime | ||
outline | ||
picker | ||
plugin | ||
plugin_macros | ||
plugin_runtime | ||
project | ||
project_panel | ||
project_symbols | ||
recent_projects | ||
rope | ||
rpc | ||
search | ||
semantic_index | ||
settings | ||
snippet | ||
sqlez | ||
sqlez_macros | ||
staff_mode | ||
sum_tree | ||
terminal | ||
terminal_view | ||
text | ||
theme | ||
theme_selector | ||
util | ||
vcs_menu | ||
vim | ||
welcome | ||
workspace | ||
xtask | ||
zed | ||
zed-actions |