Implement the rest of the worktree pulls (#32269)
Follow-up of https://github.com/zed-industries/zed/pull/19230 Implements the workspace diagnostics pulling, and replaces "pull diagnostics every open editors' buffer" strategy with "pull changed buffer's diagnostics" + "schedule workspace diagnostics pull" for the rest of the diagnostics. This means that if the server does not support the workspace diagnostics and does not return more in linked files, only the currently edited buffer has its diagnostics updated. This is better than the existing implementation that causes a lot of diagnostics pulls to be done instead, and we can add more heuristics on top later for querying more diagnostics. Release Notes: - N/A
This commit is contained in:
parent
9e5f89dc26
commit
77ead25f8c
8 changed files with 429 additions and 85 deletions
|
@ -126,8 +126,6 @@ pub struct Buffer {
|
|||
has_unsaved_edits: Cell<(clock::Global, bool)>,
|
||||
change_bits: Vec<rc::Weak<Cell<bool>>>,
|
||||
_subscriptions: Vec<gpui::Subscription>,
|
||||
/// The result id received last time when pulling diagnostics for this buffer.
|
||||
pull_diagnostics_result_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
|
@ -956,7 +954,6 @@ impl Buffer {
|
|||
completion_triggers_timestamp: Default::default(),
|
||||
deferred_ops: OperationQueue::new(),
|
||||
has_conflict: false,
|
||||
pull_diagnostics_result_id: None,
|
||||
change_bits: Default::default(),
|
||||
_subscriptions: Vec::new(),
|
||||
}
|
||||
|
@ -2763,14 +2760,6 @@ impl Buffer {
|
|||
pub fn preserve_preview(&self) -> bool {
|
||||
!self.has_edits_since(&self.preview_version)
|
||||
}
|
||||
|
||||
pub fn result_id(&self) -> Option<String> {
|
||||
self.pull_diagnostics_result_id.clone()
|
||||
}
|
||||
|
||||
pub fn set_result_id(&mut self, result_id: Option<String>) {
|
||||
self.pull_diagnostics_result_id = result_id;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue