mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
Fix path for vscode-html-language-server when found on PATH (#40832)
Don't prepend the worktree root when using an absolute path from `Worktree::which`, since that does the wrong thing when running in wasmtime given two Windows absolute paths. Also don't pass this path to `node`, since when npm installed it's a sh/cmd wrapper not a JS file. Part of #39153, also needs a fix on the vscode-langservers-extracted side (missing shebang for the vscode-html-language-server script). Release Notes: - Fixed Zed failing to run the HTML language server in some cases.
This commit is contained in:
parent
f9e0642a72
commit
bf63ff2b91
1 changed files with 12 additions and 10 deletions
|
|
@ -68,22 +68,24 @@ impl zed::Extension for HtmlExtension {
|
|||
worktree: &zed::Worktree,
|
||||
) -> Result<zed::Command> {
|
||||
let server_path = if let Some(path) = worktree.which(BINARY_NAME) {
|
||||
path
|
||||
return Ok(zed::Command {
|
||||
command: path,
|
||||
args: vec!["--stdio".to_string()],
|
||||
env: Default::default(),
|
||||
});
|
||||
} else {
|
||||
self.server_script_path(language_server_id)?
|
||||
let server_path = self.server_script_path(language_server_id)?;
|
||||
env::current_dir()
|
||||
.unwrap()
|
||||
.join(&server_path)
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
};
|
||||
self.cached_binary_path = Some(server_path.clone());
|
||||
|
||||
Ok(zed::Command {
|
||||
command: zed::node_binary_path()?,
|
||||
args: vec![
|
||||
env::current_dir()
|
||||
.unwrap()
|
||||
.join(&server_path)
|
||||
.to_string_lossy()
|
||||
.to_string(),
|
||||
"--stdio".to_string(),
|
||||
],
|
||||
args: vec![server_path, "--stdio".to_string()],
|
||||
env: Default::default(),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue