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.

windows: User installed language server support (#9606)

Ezekiel Warren0f15fd37d641
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs
index 5ede90f2309..d8b9dc115e0 100644
--- a/crates/project/src/project.rs
+++ b/crates/project/src/project.rs
@@ -9540,6 +9540,7 @@ impl LspAdapterDelegate for ProjectLspAdapterDelegate {
self.shell_env.lock().as_ref().cloned().unwrap_or_default()
}
+ #[cfg(not(target_os = "windows"))]
async fn which(&self, command: &OsStr) -> Option<PathBuf> {
let worktree_abs_path = self.worktree.abs_path();
self.load_shell_env().await;
@@ -9551,6 +9552,14 @@ impl LspAdapterDelegate for ProjectLspAdapterDelegate {
which::which_in(command, shell_path.as_ref(), &worktree_abs_path).ok()
}
+ #[cfg(target_os = "windows")]
+ async fn which(&self, command: &OsStr) -> Option<PathBuf> {
+ // todo(windows) Getting the shell env variables in a current directory on Windows is more complicated than other platforms
+ // there isn't a 'default shell' necessarily. The closest would be the default profile on the windows terminal
+ // SEE: https://learn.microsoft.com/en-us/windows/terminal/customize-settings/startup
+ which::which(command).ok()
+ }
+
fn update_status(
&self,
server_name: LanguageServerName,