From b5f524c7ff4973d58b5e5ec70765157a6cb0c526 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 24 May 2021 00:09:24 +0300 Subject: [PATCH] Don't discover workspaces when detached files are given --- crates/rust-analyzer/src/bin/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index 7ee35d52b3..6c883dd58b 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<()> { config.update(json); } - if config.linked_projects().is_empty() { + if config.linked_projects().is_empty() && config.detached_files().is_empty() { let workspace_roots = initialize_params .workspace_folders .map(|workspaces| { @@ -214,10 +214,9 @@ fn run_server() -> Result<()> { let discovered = ProjectManifest::discover_all(&workspace_roots); log::info!("discovered projects: {:?}", discovered); - if discovered.is_empty() && config.detached_files().is_empty() { + if discovered.is_empty() { log::error!("failed to find any projects in {:?}", workspace_roots); } - config.discovered_projects = Some(discovered); }