zed/crates
Max Brunsfeld 7288be4251
Make LspAdapter::process_diagnostics synchronous (#2829)
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.
2023-08-07 14:31:49 -07:00
..
activity_indicator Merge branch 'main' into fix-broken-lsp-installations 2023-06-28 16:46:06 -04:00
ai disable wrap guides in the assitant panel 2023-07-28 22:27:36 -07:00
audio Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
auto_update Split out Interactive<T> into Toggle<T> and Interactive<T> 2023-06-20 16:05:20 -07:00
breadcrumbs Split out Interactive<T> into Toggle<T> and Interactive<T> 2023-06-20 16:05:20 -07:00
call Add microphone toggle events (#2765) 2023-07-20 16:10:20 -04:00
cli Prevent duplicate instances by coordinating via a socket 2023-07-07 14:19:44 -04:00
client Add is_staff to events 2023-07-18 12:32:53 -04:00
clock
collab WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
collab_ui Don't refcount window handles 2023-08-03 17:11:47 -06:00
collections
command_palette Don't refcount window handles 2023-08-03 17:11:47 -06:00
context_menu Introduce a WindowContext::focus method that implies the window id 2023-07-05 09:39:04 +02:00
copilot Use WindowHandles in a couple places 2023-08-03 17:46:34 -06:00
copilot_button Remove on_click_out handler from context menu 2023-06-29 17:10:51 -07:00
db Simplify db tests 2023-07-14 16:09:02 -07:00
diagnostics Don't refcount window handles 2023-08-03 17:11:47 -06:00
drag_and_drop
editor Expand empty selections to cover full word and fix bugs 2023-08-05 11:31:21 -04:00
feedback Prevent multiple submissions of the same feedback text 2023-07-17 16:10:34 -04:00
file_finder Don't refcount window handles 2023-08-03 17:11:47 -06:00
fs Fix pathspec in staged_statuses 2023-07-23 21:36:29 -07:00
fsevent
fuzzy
git
go_to_line Add Modal::has_focus and introduce a ModalHandle trait object 2023-07-05 09:39:56 +02:00
gpui Use WindowHandles in a couple places 2023-08-03 17:46:34 -06:00
gpui_macros Add a derive macro for Element 2023-06-25 07:51:50 -06:00
install_cli
journal
language Make LspAdapter::process_diagnostics synchronous 2023-08-07 13:53:41 -07:00
language_selector feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
language_tools WIP 2023-08-03 17:03:39 -06:00
live_kit_client Put LiveKitBridge Swift build directory in target 2023-07-28 18:53:24 -04:00
live_kit_server
lsp Add scaffolding of php language server 2023-07-17 11:43:32 +02:00
media
menu feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
node_runtime Reattempt Node installation if the installation itself errors 2023-07-28 15:24:40 -04:00
outline feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
picker feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
plugin
plugin_macros
plugin_runtime
project Make LspAdapter::process_diagnostics synchronous 2023-08-07 13:53:41 -07:00
project_panel WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820) 2023-08-03 18:45:51 -06:00
project_symbols Don't refcount window handles 2023-08-03 17:11:47 -06:00
recent_projects Add PathExt trait (#2823) 2023-08-03 18:57:43 -04:00
rope Simplify InlayMap::splice interface 2023-06-29 22:25:49 +03:00
rpc Post-rebase fixes 2023-06-29 22:39:33 +03:00
search Don't refcount window handles 2023-08-03 17:11:47 -06:00
semantic_index catchup with main 2023-08-01 10:40:38 -04:00
settings Accept null as a valid action, to disable a keystroke 2023-07-04 21:11:28 +03:00
snippet
sqlez
sqlez_macros
staff_mode
sum_tree Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
terminal Update Alacritty 2023-07-27 12:19:07 -04:00
terminal_view WIP 2023-08-03 17:03:39 -06:00
text Remove excessive hint update queries 2023-06-30 22:03:21 +03:00
theme Update status bar theming 2023-07-25 11:06:41 -06:00
theme_selector feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
util Fix test name 2023-08-07 17:07:01 -04:00
vcs_menu feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
vim Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
welcome feat(workspace): allow alternative actions to open files and symbols in split 2023-07-14 21:49:15 +02:00
workspace Don't refcount window handles 2023-08-03 17:11:47 -06:00
xtask Fixup xtask compilation 2023-06-22 18:06:52 +02:00
zed Make LspAdapter::process_diagnostics synchronous (#2829) 2023-08-07 14:31:49 -07:00
zed-actions Add Sign in button for an unregistered user 2023-06-15 22:05:43 -07:00