mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 05:08:52 +00:00
fix: Fix flycheck cancellations leaving stale errors
This commit is contained in:
parent
7e639ee3dd
commit
189baf661e
1 changed files with 18 additions and 14 deletions
|
@ -353,19 +353,7 @@ impl FlycheckActor {
|
||||||
package_id: None,
|
package_id: None,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
for (package_id, status) in mem::take(&mut self.package_status) {
|
self.send_clear_diagnostics();
|
||||||
if let DiagnosticReceived::No = status {
|
|
||||||
tracing::trace!(
|
|
||||||
flycheck_id = self.id,
|
|
||||||
package_id = package_id.repr,
|
|
||||||
"clearing diagnostics"
|
|
||||||
);
|
|
||||||
self.send(FlycheckMessage::ClearDiagnostics {
|
|
||||||
id: self.id,
|
|
||||||
package_id: Some(package_id),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.report_progress(Progress::DidFinish(res));
|
self.report_progress(Progress::DidFinish(res));
|
||||||
|
@ -429,7 +417,23 @@ impl FlycheckActor {
|
||||||
command_handle.cancel();
|
command_handle.cancel();
|
||||||
self.command_receiver.take();
|
self.command_receiver.take();
|
||||||
self.report_progress(Progress::DidCancel);
|
self.report_progress(Progress::DidCancel);
|
||||||
self.package_status.clear();
|
self.send_clear_diagnostics();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn send_clear_diagnostics(&mut self) {
|
||||||
|
for (package_id, status) in mem::take(&mut self.package_status) {
|
||||||
|
if let DiagnosticReceived::No = status {
|
||||||
|
tracing::trace!(
|
||||||
|
flycheck_id = self.id,
|
||||||
|
package_id = package_id.repr,
|
||||||
|
"clearing diagnostics"
|
||||||
|
);
|
||||||
|
self.send(FlycheckMessage::ClearDiagnostics {
|
||||||
|
id: self.id,
|
||||||
|
package_id: Some(package_id),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue