mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Merge #4932
4932: Simplify r=matklad a=Veetaha Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
commit
f5af48dc49
1 changed files with 6 additions and 10 deletions
|
@ -33,19 +33,15 @@ use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
|
|
||||||
fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> {
|
fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> {
|
||||||
// FIXME: Figure out the multi-workspace situation
|
// FIXME: Figure out the multi-workspace situation
|
||||||
workspaces
|
workspaces.iter().find_map(|w| match w {
|
||||||
.iter()
|
ProjectWorkspace::Cargo { cargo, .. } => {
|
||||||
.find_map(|w| match w {
|
|
||||||
ProjectWorkspace::Cargo { cargo, .. } => Some(cargo),
|
|
||||||
ProjectWorkspace::Json { .. } => None,
|
|
||||||
})
|
|
||||||
.map(|cargo| {
|
|
||||||
let cargo_project_root = cargo.workspace_root().to_path_buf();
|
let cargo_project_root = cargo.workspace_root().to_path_buf();
|
||||||
Some(Flycheck::new(config.clone(), cargo_project_root))
|
Some(Flycheck::new(config.clone(), cargo_project_root))
|
||||||
})
|
}
|
||||||
.unwrap_or_else(|| {
|
ProjectWorkspace::Json { .. } => {
|
||||||
log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
|
log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
|
||||||
None
|
None
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue