From c7298428042b6f8ebffa50344af894fd71aa9c63 Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Tue, 1 Apr 2025 00:26:29 -0300 Subject: [PATCH] assistant2: Exclude deleted files from stale list (#27821) Release Notes: - N/A --- crates/assistant_tool/src/action_log.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/assistant_tool/src/action_log.rs b/crates/assistant_tool/src/action_log.rs index 2842aeddf2..099378464d 100644 --- a/crates/assistant_tool/src/action_log.rs +++ b/crates/assistant_tool/src/action_log.rs @@ -402,7 +402,14 @@ impl ActionLog { pub fn stale_buffers<'a>(&'a self, cx: &'a App) -> impl Iterator> { self.tracked_buffers .iter() - .filter(|(buffer, tracked)| tracked.version != buffer.read(cx).version) + .filter(|(buffer, tracked)| { + let buffer = buffer.read(cx); + + tracked.version != buffer.version + && buffer + .file() + .map_or(false, |file| file.disk_state() != DiskState::Deleted) + }) .map(|(buffer, _)| buffer) }