aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-05-23 22:09:24 +0100
committerKirill Bulatov <[email protected]>2021-05-23 22:09:24 +0100
commitb5f524c7ff4973d58b5e5ec70765157a6cb0c526 (patch)
tree5c622da9be282c8a044171982b4eea82556cce79
parentc1f6a5a0b0df92b6fb61aab92fe612d179fbab5d (diff)
Don't discover workspaces when detached files are given
-rw-r--r--crates/rust-analyzer/src/bin/main.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs
index 7ee35d52b..6c883dd58 100644
--- a/crates/rust-analyzer/src/bin/main.rs
+++ b/crates/rust-analyzer/src/bin/main.rs
@@ -199,7 +199,7 @@ fn run_server() -> Result<()> {
199 config.update(json); 199 config.update(json);
200 } 200 }
201 201
202 if config.linked_projects().is_empty() { 202 if config.linked_projects().is_empty() && config.detached_files().is_empty() {
203 let workspace_roots = initialize_params 203 let workspace_roots = initialize_params
204 .workspace_folders 204 .workspace_folders
205 .map(|workspaces| { 205 .map(|workspaces| {
@@ -214,10 +214,9 @@ fn run_server() -> Result<()> {
214 214
215 let discovered = ProjectManifest::discover_all(&workspace_roots); 215 let discovered = ProjectManifest::discover_all(&workspace_roots);
216 log::info!("discovered projects: {:?}", discovered); 216 log::info!("discovered projects: {:?}", discovered);
217 if discovered.is_empty() && config.detached_files().is_empty() { 217 if discovered.is_empty() {
218 log::error!("failed to find any projects in {:?}", workspace_roots); 218 log::error!("failed to find any projects in {:?}", workspace_roots);
219 } 219 }
220
221 config.discovered_projects = Some(discovered); 220 config.discovered_projects = Some(discovered);
222 } 221 }
223 222