html: Remove Windows workaround (#38069)

⚠️ Don't merge until Zed 0.205.x is on stable ⚠️ 

See https://github.com/zed-industries/zed/pull/37811

This PR updates the HTML extension, bumping the zed extension API to the
latest version, which removes the need to work around a bug where
`current_dir()` returned an invalid path on windows.

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld
2025-09-26 12:14:54 -07:00
committed by GitHub
parent bd3cccea15
commit 837f282f1e
3 changed files with 15 additions and 24 deletions
+2 -22
View File
@@ -77,7 +77,8 @@ impl zed::Extension for HtmlExtension {
Ok(zed::Command {
command: zed::node_binary_path()?,
args: vec![
zed_ext::sanitize_windows_path(env::current_dir().unwrap())
env::current_dir()
.unwrap()
.join(&server_path)
.to_string_lossy()
.to_string(),
@@ -110,24 +111,3 @@ impl zed::Extension for HtmlExtension {
}
zed::register_extension!(HtmlExtension);
mod zed_ext {
/// Sanitizes the given path to remove the leading `/` on Windows.
///
/// On macOS and Linux this is a no-op.
///
/// This is a workaround for https://github.com/bytecodealliance/wasmtime/issues/10415.
pub fn sanitize_windows_path(path: std::path::PathBuf) -> std::path::PathBuf {
use zed_extension_api::{Os, current_platform};
let (os, _arch) = current_platform();
match os {
Os::Mac | Os::Linux => path,
Os::Windows => path
.to_string_lossy()
.to_string()
.trim_start_matches('/')
.into(),
}
}
}