diff options
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index ef6c7d44d..1fab5ea4f 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -33,20 +33,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; | |||
33 | 33 | ||
34 | fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> { | 34 | fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> { |
35 | // FIXME: Figure out the multi-workspace situation | 35 | // FIXME: Figure out the multi-workspace situation |
36 | workspaces | 36 | workspaces.iter().find_map(|w| match w { |
37 | .iter() | 37 | ProjectWorkspace::Cargo { cargo, .. } => { |
38 | .find_map(|w| match w { | ||
39 | ProjectWorkspace::Cargo { cargo, .. } => Some(cargo), | ||
40 | ProjectWorkspace::Json { .. } => None, | ||
41 | }) | ||
42 | .map(|cargo| { | ||
43 | let cargo_project_root = cargo.workspace_root().to_path_buf(); | 38 | let cargo_project_root = cargo.workspace_root().to_path_buf(); |
44 | Some(Flycheck::new(config.clone(), cargo_project_root)) | 39 | Some(Flycheck::new(config.clone(), cargo_project_root)) |
45 | }) | 40 | } |
46 | .unwrap_or_else(|| { | 41 | ProjectWorkspace::Json { .. } => { |
47 | log::warn!("Cargo check watching only supported for cargo workspaces, disabling"); | 42 | log::warn!("Cargo check watching only supported for cargo workspaces, disabling"); |
48 | None | 43 | None |
49 | }) | 44 | } |
45 | }) | ||
50 | } | 46 | } |
51 | 47 | ||
52 | /// `GlobalState` is the primary mutable state of the language server | 48 | /// `GlobalState` is the primary mutable state of the language server |