Preserve diagnostic source authority when recovery removes save notice

This commit is contained in:
2026-09-13 05:06:50 -07:00
parent 92ff99eb54
commit 554cfbd9fe
2 changed files with 166 additions and 7 deletions
+11 -7
View File
@@ -3390,13 +3390,17 @@ impl App {
}
self.invalidate_source_rename("Disk recovery changed this source context. Your replacement is retained; close and invoke Rename again.");
self.pending_recovery = None;
let diagnostics = self
.source_diagnostics
.iter()
.filter(|issue| issue.diagnostic.code != "pending_save")
.cloned()
.collect();
self.publish_source_diagnostics(diagnostics);
// Removing the recovered-save notice changes presentation,
// not the source authority of the remaining locations.
let diagnostics_current = self
.text_workspace
.diagnostic_publication()
.is_some_and(|publication| publication.source() == self.source_key());
self.source_diagnostics
.retain(|issue| issue.diagnostic.code != "pending_save");
if diagnostics_current {
self.publish_source_diagnostics(self.source_diagnostics.clone());
}
match receipt.disk {
Ok(disk) if !self.source_workspace.applied => {
self.open_source_project(disk)