html: Remove Windows workaround (#38069)

Max Brunsfeld created

⚠️ 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

Change summary

Cargo.lock                  | 13 ++++++++++++-
extensions/html/Cargo.toml  |  2 +-
extensions/html/src/html.rs | 24 ++----------------------
3 files changed, 15 insertions(+), 24 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -20397,6 +20397,17 @@ dependencies = [
  "wit-bindgen 0.41.0",
 ]
 
+[[package]]
+name = "zed_extension_api"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0729d50b4ca0a7e28e590bbe32e3ca0194d97ef654961451a424c661a366fca0"
+dependencies = [
+ "serde",
+ "serde_json",
+ "wit-bindgen 0.41.0",
+]
+
 [[package]]
 name = "zed_glsl"
 version = "0.1.0"
@@ -20408,7 +20419,7 @@ dependencies = [
 name = "zed_html"
 version = "0.2.2"
 dependencies = [
- "zed_extension_api 0.1.0",
+ "zed_extension_api 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]

extensions/html/Cargo.toml 🔗

@@ -13,4 +13,4 @@ path = "src/html.rs"
 crate-type = ["cdylib"]
 
 [dependencies]
-zed_extension_api = "0.1.0"
+zed_extension_api = "0.7.0"

extensions/html/src/html.rs 🔗

@@ -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(),
-        }
-    }
-}