aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/src/world.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index cea18937f..a52bd2633 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -132,20 +132,20 @@ impl WorldState {
132 change.set_crate_graph(crate_graph); 132 change.set_crate_graph(crate_graph);
133 133
134 // FIXME: Figure out the multi-workspace situation 134 // FIXME: Figure out the multi-workspace situation
135 let check_watcher = { 135 let check_watcher = workspaces
136 let first_workspace = workspaces.first().unwrap(); 136 .iter()
137 let cargo_project_root = match first_workspace { 137 .find_map(|w| match w {
138 ProjectWorkspace::Cargo { cargo, .. } => cargo.workspace_root().to_path_buf(), 138 ProjectWorkspace::Cargo { cargo, .. } => Some(cargo),
139 ProjectWorkspace::Json { .. } => { 139 ProjectWorkspace::Json { .. } => None,
140 log::warn!( 140 })
141 "Cargo check watching only supported for cargo workspaces, disabling" 141 .map(|cargo| {
142 ); 142 let cargo_project_root = cargo.workspace_root().to_path_buf();
143 options.cargo_watch.enable = false; 143 CheckWatcher::new(&options.cargo_watch, cargo_project_root)
144 PathBuf::new() 144 })
145 } 145 .unwrap_or_else(|| {
146 }; 146 log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
147 CheckWatcher::new(&options.cargo_watch, cargo_project_root) 147 CheckWatcher::dummy()
148 }; 148 });
149 149
150 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags); 150 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags);
151 analysis_host.apply_change(change); 151 analysis_host.apply_change(change);