aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/world.rs')
-rw-r--r--crates/ra_lsp_server/src/world.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index 121ddfd1f..c0175c726 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -132,8 +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 CheckWatcher::new(&options.cargo_watch, folder_roots.first().cloned().unwrap()); 136 .iter()
137 .find_map(|w| match w {
138 ProjectWorkspace::Cargo { cargo, .. } => Some(cargo),
139 ProjectWorkspace::Json { .. } => None,
140 })
141 .map(|cargo| {
142 let cargo_project_root = cargo.workspace_root().to_path_buf();
143 CheckWatcher::new(&options.cargo_watch, cargo_project_root)
144 })
145 .unwrap_or_else(|| {
146 log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
147 CheckWatcher::dummy()
148 });
137 149
138 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags); 150 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags);
139 analysis_host.apply_change(change); 151 analysis_host.apply_change(change);