diff --git a/Cargo.lock b/Cargo.lock index 7be9a9024000e399d08eb53350e04d8a93c68d3e..38e993f21c0d61e0165d43169efee8e86193fc9a 100644 --- a/Cargo.lock +++ b/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]] diff --git a/extensions/html/Cargo.toml b/extensions/html/Cargo.toml index 27425da67185b80935c55b8bdc9e02088650a06b..b8d0513f9bfcef5e2b61534a227d36a15a878e1b 100644 --- a/extensions/html/Cargo.toml +++ b/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" diff --git a/extensions/html/src/html.rs b/extensions/html/src/html.rs index 371824c830ae7b0ef0e2d7391f6262825470aa88..27fd2d1e2226a764cdcc3de29d607f3d3db8fd5d 100644 --- a/extensions/html/src/html.rs +++ b/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(), - } - } -}