Batch diagnostics updates (#35794)
Diagnostics updates were programmed in Zed based off the r-a LSP push diagnostics, with all related updates happening per file. https://github.com/zed-industries/zed/pull/19230 and especially https://github.com/zed-industries/zed/pull/32269 brought in pull diagnostics that could produce results for thousands files simultaneously. It was noted and addressed on the local side in https://github.com/zed-industries/zed/pull/34022 but the remote side was still not adjusted properly. This PR * removes redundant diagnostics pull updates on remote clients, as buffer diagnostics are updated via buffer sync operations separately * batches all diagnostics-related updates and proto messages, so multiple diagnostic summaries (per file) could be sent at once, specifically, 1 (potentially large) diagnostics summary update instead of N*10^3 small ones. Buffer updates are still sent per buffer and not updated, as happening separately and not offending the collab traffic that much. Release Notes: - Improved diagnostics performance in the collaborative mode
This commit is contained in:
parent
a5c25e0366
commit
740686b883
7 changed files with 500 additions and 350 deletions
|
@ -1630,15 +1630,15 @@ fn notify_rejoined_projects(
|
|||
}
|
||||
|
||||
// Stream this worktree's diagnostics.
|
||||
for summary in worktree.diagnostic_summaries {
|
||||
session.peer.send(
|
||||
session.connection_id,
|
||||
proto::UpdateDiagnosticSummary {
|
||||
project_id: project.id.to_proto(),
|
||||
worktree_id: worktree.id,
|
||||
summary: Some(summary),
|
||||
},
|
||||
)?;
|
||||
let mut worktree_diagnostics = worktree.diagnostic_summaries.into_iter();
|
||||
if let Some(summary) = worktree_diagnostics.next() {
|
||||
let message = proto::UpdateDiagnosticSummary {
|
||||
project_id: project.id.to_proto(),
|
||||
worktree_id: worktree.id,
|
||||
summary: Some(summary),
|
||||
more_summaries: worktree_diagnostics.collect(),
|
||||
};
|
||||
session.peer.send(session.connection_id, message)?;
|
||||
}
|
||||
|
||||
for settings_file in worktree.settings_files {
|
||||
|
@ -2060,15 +2060,15 @@ async fn join_project(
|
|||
}
|
||||
|
||||
// Stream this worktree's diagnostics.
|
||||
for summary in worktree.diagnostic_summaries {
|
||||
session.peer.send(
|
||||
session.connection_id,
|
||||
proto::UpdateDiagnosticSummary {
|
||||
project_id: project_id.to_proto(),
|
||||
worktree_id: worktree.id,
|
||||
summary: Some(summary),
|
||||
},
|
||||
)?;
|
||||
let mut worktree_diagnostics = worktree.diagnostic_summaries.into_iter();
|
||||
if let Some(summary) = worktree_diagnostics.next() {
|
||||
let message = proto::UpdateDiagnosticSummary {
|
||||
project_id: project.id.to_proto(),
|
||||
worktree_id: worktree.id,
|
||||
summary: Some(summary),
|
||||
more_summaries: worktree_diagnostics.collect(),
|
||||
};
|
||||
session.peer.send(session.connection_id, message)?;
|
||||
}
|
||||
|
||||
for settings_file in worktree.settings_files {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue