Preserve diagnostic source authority when recovery removes save notice
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user