Pull diagnostics fixes (#32242)

Follow-up of https://github.com/zed-industries/zed/pull/19230

* starts to send `result_id` in pull requests to allow servers to reply
with non-full results
* fixes a bug where disk-based diagnostics were offset after pulling the
diagnostics
* fixes a bug due to which pull diagnostics could not be disabled
* uses better names and comments for the workspace pull diagnostics part

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-06-06 16:18:05 +03:00 committed by GitHub
parent 508b604b67
commit 380d8c5662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 272 additions and 109 deletions

View file

@ -1332,6 +1332,7 @@ async fn test_single_file_worktrees_diagnostics(cx: &mut gpui::TestAppContext) {
..Default::default()
}],
},
None,
DiagnosticSourceKind::Pushed,
&[],
cx,
@ -1350,6 +1351,7 @@ async fn test_single_file_worktrees_diagnostics(cx: &mut gpui::TestAppContext) {
..Default::default()
}],
},
None,
DiagnosticSourceKind::Pushed,
&[],
cx,
@ -1441,6 +1443,7 @@ async fn test_omitted_diagnostics(cx: &mut gpui::TestAppContext) {
..Default::default()
}],
},
None,
DiagnosticSourceKind::Pushed,
&[],
cx,
@ -1459,6 +1462,7 @@ async fn test_omitted_diagnostics(cx: &mut gpui::TestAppContext) {
..Default::default()
}],
},
None,
DiagnosticSourceKind::Pushed,
&[],
cx,
@ -2376,6 +2380,7 @@ async fn test_empty_diagnostic_ranges(cx: &mut gpui::TestAppContext) {
LanguageServerId(0),
PathBuf::from("/dir/a.rs"),
None,
None,
vec![
DiagnosticEntry {
range: Unclipped(PointUtf16::new(0, 10))
@ -2442,6 +2447,7 @@ async fn test_diagnostics_from_multiple_language_servers(cx: &mut gpui::TestAppC
LanguageServerId(0),
Path::new("/dir/a.rs").to_owned(),
None,
None,
vec![DiagnosticEntry {
range: Unclipped(PointUtf16::new(0, 0))..Unclipped(PointUtf16::new(0, 3)),
diagnostic: Diagnostic {
@ -2460,6 +2466,7 @@ async fn test_diagnostics_from_multiple_language_servers(cx: &mut gpui::TestAppC
LanguageServerId(1),
Path::new("/dir/a.rs").to_owned(),
None,
None,
vec![DiagnosticEntry {
range: Unclipped(PointUtf16::new(0, 0))..Unclipped(PointUtf16::new(0, 3)),
diagnostic: Diagnostic {
@ -4596,6 +4603,7 @@ async fn test_grouped_diagnostics(cx: &mut gpui::TestAppContext) {
lsp_store.update_diagnostics(
LanguageServerId(0),
message,
None,
DiagnosticSourceKind::Pushed,
&[],
cx,