Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
project: Update variable and change comment (#17933)
Thorsten Ball2165d52d3e97
diff --git a/crates/language/src/language_registry.rs b/crates/language/src/language_registry.rsindex 4870c4ed539..918da4873f8 100644--- a/crates/language/src/language_registry.rs+++ b/crates/language/src/language_registry.rs@@ -860,7 +860,7 @@ impl LanguageRegistry {adapter: Arc<CachedLspAdapter>,root_path: Arc<Path>,delegate: Arc<dyn LspAdapterDelegate>,- cli_environment: Shared<Task<Option<HashMap<String, String>>>>,+ project_environment: Shared<Task<Option<HashMap<String, String>>>>,cx: &mut AppContext,) -> Option<PendingLanguageServer> {let server_id = self.state.write().next_language_server_id();@@ -881,7 +881,7 @@ impl LanguageRegistry {let task = cx.spawn({let container_dir = container_dir.clone();move |mut cx| async move {- let cli_environment = cli_environment.await;+ let project_environment = project_environment.await;let binary_result = adapter.clone()@@ -892,15 +892,16 @@ impl LanguageRegistry {let mut binary = binary_result?;- // If this Zed project was opened from the CLI and the language server command itself+ // If we do have a project environment (either by spawning a shell in in the project directory+ // or by getting it from the CLI) and the language server command itself// doesn't have an environment (which it would have, if it was found in $PATH), then- // we pass along the CLI environment that we inherited.- if binary.env.is_none() && cli_environment.is_some() {+ // we use the project environment.+ if binary.env.is_none() && project_environment.is_some() {log::info!(- "using CLI environment for language server {:?}, id: {server_id}",+ "using project environment for language server {:?}, id: {server_id}",adapter.name.0);- binary.env = cli_environment.clone();+ binary.env = project_environment.clone();}let options = adapterdiff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rsindex fb3d52eb9eb..e1e6001d24b 100644--- a/crates/project/src/lsp_store.rs+++ b/crates/project/src/lsp_store.rs@@ -4646,7 +4646,7 @@ impl LspStore {let stderr_capture = Arc::new(Mutex::new(Some(String::new())));let lsp_adapter_delegate = ProjectLspAdapterDelegate::for_local(self, worktree_handle, cx);- let cli_environment = local.environment.update(cx, |environment, cx| {+ let project_environment = local.environment.update(cx, |environment, cx| {environment.get_environment(Some(worktree_id), Some(worktree_path.clone()), cx)});@@ -4656,7 +4656,7 @@ impl LspStore {adapter.clone(),Arc::clone(&worktree_path),lsp_adapter_delegate.clone(),- cli_environment,+ project_environment,cx,) {Some(pending_server) => pending_server,