Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix PATH lookup to handle Windows case sensitivity (#40711)

ming_jiangea5f3e6086e4
diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs
index c68d14d3886..e8eaa493de9 100644
--- a/crates/project/src/lsp_store.rs
+++ b/crates/project/src/lsp_store.rs
@@ -12760,7 +12760,16 @@ impl LspAdapterDelegate for LocalLspAdapterDelegate {
if self.fs.is_file(&worktree_abs_path).await {
worktree_abs_path.pop();
}
- let shell_path = self.shell_env().await.get("PATH").cloned();
+
+ let env = self.shell_env().await;
+
+ // On Windows, PATH might be "Path" instead of "PATH"
+ let shell_path = env
+ .get("PATH")
+ .or_else(|| env.get("Path"))
+ .or_else(|| env.get("path"))
+ .cloned();
+
which::which_in(command, shell_path.as_ref(), worktree_abs_path).ok()
}