Files
oak-gpui/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
..
2023-07-20 16:10:20 -04:00
2023-07-18 12:32:53 -04:00
2023-08-03 17:11:47 -06:00
2023-07-14 16:09:02 -07:00
2023-08-03 17:11:47 -06:00
2023-08-03 17:11:47 -06:00
2023-07-23 21:36:29 -07:00
2023-08-03 17:46:34 -06:00
WIP
2023-08-03 17:03:39 -06:00
2023-08-03 18:57:43 -04:00
2023-06-29 22:25:49 +03:00
2023-06-29 22:39:33 +03:00
2023-08-03 17:11:47 -06:00
2023-08-01 10:40:38 -04:00
2023-07-27 12:19:07 -04:00
WIP
2023-08-03 17:03:39 -06:00
2023-06-30 22:03:21 +03:00
2023-07-25 11:06:41 -06:00
2023-08-07 17:07:01 -04:00
2023-08-02 09:19:23 -07:00
2023-08-03 17:11:47 -06:00