aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/global_state.rs16
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 ee1d37ea2..ca95d776a 100644
--- a/crates/rust-analyzer/src/global_state.rs
+++ b/crates/rust-analyzer/src/global_state.rs
@@ -30,20 +30,16 @@ use rustc_hash::{FxHashMap, FxHashSet};
30 30
31fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> { 31fn create_flycheck(workspaces: &[ProjectWorkspace], config: &FlycheckConfig) -> Option<Flycheck> {
32 // FIXME: Figure out the multi-workspace situation 32 // FIXME: Figure out the multi-workspace situation
33 workspaces 33 workspaces.iter().find_map(|w| match w {
34 .iter() 34 ProjectWorkspace::Cargo { cargo, .. } => {
35 .find_map(|w| match w {
36 ProjectWorkspace::Cargo { cargo, .. } => Some(cargo),
37 ProjectWorkspace::Json { .. } => None,
38 })
39 .map(|cargo| {
40 let cargo_project_root = cargo.workspace_root().to_path_buf(); 35 let cargo_project_root = cargo.workspace_root().to_path_buf();
41 Some(Flycheck::new(config.clone(), cargo_project_root)) 36 Some(Flycheck::new(config.clone(), cargo_project_root))
42 }) 37 }
43 .unwrap_or_else(|| { 38 ProjectWorkspace::Json { .. } => {
44 log::warn!("Cargo check watching only supported for cargo workspaces, disabling"); 39 log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
45 None 40 None
46 }) 41 }
42 })
47} 43}
48 44
49/// `GlobalState` is the primary mutable state of the language server 45/// `GlobalState` is the primary mutable state of the language server