This commit is contained in:
Veetaha 2020-06-18 02:00:48 +03:00
parent 1ce8c2b5a0
commit 9bb028189a

View file

@ -33,19 +33,15 @@ use rustc_hash::{FxHashMap, FxHashSet};
fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> {
// FIXME: Figure out the multi-workspace situation
workspaces
.iter()
.find_map(|w| match w {
ProjectWorkspace::Cargo { cargo, .. } => Some(cargo),
ProjectWorkspace::Json { .. } => None,
})
.map(|cargo| {
workspaces.iter().find_map(|w| match w {
ProjectWorkspace::Cargo { cargo, .. } => {
let cargo_project_root = cargo.workspace_root().to_path_buf();
Some(Flycheck::new(config.clone(), cargo_project_root))
})
.unwrap_or_else(|| {
}
ProjectWorkspace::Json { .. } => {
log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
None
}
})
}