mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix: Fix flycheck sending cancel progress with no running process
This commit is contained in:
parent
ce36446943
commit
ddddca8717
1 changed files with 3 additions and 5 deletions
|
@ -157,12 +157,9 @@ impl FlycheckActor {
|
||||||
while let Some(event) = self.next_event(&inbox) {
|
while let Some(event) = self.next_event(&inbox) {
|
||||||
match event {
|
match event {
|
||||||
Event::Restart(Restart) => {
|
Event::Restart(Restart) => {
|
||||||
if let Some(cargo_handle) = self.cargo_handle.take() {
|
|
||||||
// Cancel the previously spawned process
|
// Cancel the previously spawned process
|
||||||
cargo_handle.cancel();
|
self.cancel_check_process();
|
||||||
}
|
|
||||||
while let Ok(Restart) = inbox.recv_timeout(Duration::from_millis(50)) {}
|
while let Ok(Restart) = inbox.recv_timeout(Duration::from_millis(50)) {}
|
||||||
self.progress(Progress::DidCancel);
|
|
||||||
|
|
||||||
let command = self.check_command();
|
let command = self.check_command();
|
||||||
tracing::debug!(?command, "will restart flycheck");
|
tracing::debug!(?command, "will restart flycheck");
|
||||||
|
@ -221,6 +218,7 @@ impl FlycheckActor {
|
||||||
self.progress(Progress::DidCancel);
|
self.progress(Progress::DidCancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_command(&self) -> Command {
|
fn check_command(&self) -> Command {
|
||||||
let mut cmd = match &self.config {
|
let mut cmd = match &self.config {
|
||||||
FlycheckConfig::CargoCommand {
|
FlycheckConfig::CargoCommand {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue