mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Pop an error notification when flycheck can't be restarted
This commit is contained in:
parent
dea163970a
commit
2abb78d06d
2 changed files with 13 additions and 4 deletions
|
@ -125,6 +125,7 @@ pub enum Progress {
|
||||||
DidCheckCrate(String),
|
DidCheckCrate(String),
|
||||||
DidFinish(io::Result<()>),
|
DidFinish(io::Result<()>),
|
||||||
DidCancel,
|
DidCancel,
|
||||||
|
DidFailToRestart(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Restart {
|
enum Restart {
|
||||||
|
@ -193,10 +194,11 @@ impl FlycheckActor {
|
||||||
self.progress(Progress::DidStart);
|
self.progress(Progress::DidStart);
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::error!(
|
self.progress(Progress::DidFailToRestart(format!(
|
||||||
command = ?self.check_command(),
|
"Failed to run the following command: {:?} error={}",
|
||||||
%error, "failed to restart flycheck"
|
self.check_command(),
|
||||||
);
|
error
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,6 +529,13 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
flycheck::Progress::DidCheckCrate(target) => (Progress::Report, Some(target)),
|
flycheck::Progress::DidCheckCrate(target) => (Progress::Report, Some(target)),
|
||||||
flycheck::Progress::DidCancel => (Progress::End, None),
|
flycheck::Progress::DidCancel => (Progress::End, None),
|
||||||
|
flycheck::Progress::DidFailToRestart(err) => {
|
||||||
|
self.show_and_log_error(
|
||||||
|
"cargo check failed".to_string(),
|
||||||
|
Some(err.to_string()),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
flycheck::Progress::DidFinish(result) => {
|
flycheck::Progress::DidFinish(result) => {
|
||||||
if let Err(err) = result {
|
if let Err(err) = result {
|
||||||
self.show_and_log_error(
|
self.show_and_log_error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue