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.

extension_api: Remove x86 support (#58259)

Finn Evers53667331bdaa
diff --git a/crates/extension_api/wit/since_v0.8.0/platform.wit b/crates/extension_api/wit/since_v0.8.0/platform.wit
index 48472a99bc1..6bdd0a45fb0 100644
--- a/crates/extension_api/wit/since_v0.8.0/platform.wit
+++ b/crates/extension_api/wit/since_v0.8.0/platform.wit
@@ -13,8 +13,6 @@ interface platform {
enum architecture {
/// AArch64 (e.g., Apple Silicon).
aarch64,
- /// x86.
- x86,
/// x86-64.
x8664,
}
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs
index c231b7e5d69..55af3ae8aae 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs
@@ -20,9 +20,9 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.0.1",
with: {
- "worktree": ExtensionWorktree,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/platform": latest::zed::extension::platform,
+ "worktree": ExtensionWorktree,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
},
});
@@ -132,7 +132,7 @@ impl ExtensionImports for WasmState {
}
async fn current_platform(&mut self) -> Result<(Os, Architecture)> {
- latest::zed::extension::platform::Host::current_platform(self).await
+ since_v0_6_0::zed::extension::platform::Host::current_platform(self).await
}
async fn set_language_server_installation_status(
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs
index 41d652cec30..b967af4ebf2 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs
@@ -18,9 +18,9 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.0.4",
with: {
- "worktree": ExtensionWorktree,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/platform": latest::zed::extension::platform,
+ "worktree": ExtensionWorktree,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
},
});
@@ -141,7 +141,7 @@ impl ExtensionImports for WasmState {
}
async fn current_platform(&mut self) -> Result<(Os, Architecture)> {
- latest::zed::extension::platform::Host::current_platform(self).await
+ since_v0_6_0::zed::extension::platform::Host::current_platform(self).await
}
async fn set_language_server_installation_status(
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs
index e1dfdf8248b..cd731372276 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs
@@ -18,11 +18,11 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.0.6",
with: {
- "worktree": ExtensionWorktree,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/lsp": since_v0_1_0::zed::extension::lsp,
- "zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
+ "worktree": ExtensionWorktree,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/lsp": since_v0_1_0::zed::extension::lsp,
+ "zed:extension/nodejs": latest::zed::extension::nodejs,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
},
});
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs
index fca4dca2459..288b31b2202 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs
@@ -34,13 +34,13 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.1.0",
with: {
- "worktree": ExtensionWorktree,
- "key-value-store": ExtensionKeyValueStore,
- "zed:extension/http-client/http-response-stream": ExtensionHttpResponseStream,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
- "zed:extension/slash-command": latest::zed::extension::slash_command,
+ "worktree": ExtensionWorktree,
+ "key-value-store": ExtensionKeyValueStore,
+ "zed:extension/http-client/http-response-stream": ExtensionHttpResponseStream,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/nodejs": latest::zed::extension::nodejs,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
+ "zed:extension/slash-command": latest::zed::extension::slash_command,
},
});
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs
index 691e6d2dd54..1575c8a1d87 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs
@@ -19,15 +19,15 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.2.0",
with: {
- "worktree": ExtensionWorktree,
- "project": ExtensionProject,
- "key-value-store": ExtensionKeyValueStore,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/http-client": latest::zed::extension::http_client,
- "zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
- "zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
- "zed:extension/slash-command": latest::zed::extension::slash_command,
+ "worktree": ExtensionWorktree,
+ "project": ExtensionProject,
+ "key-value-store": ExtensionKeyValueStore,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/http-client": latest::zed::extension::http_client,
+ "zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
+ "zed:extension/nodejs": latest::zed::extension::nodejs,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
+ "zed:extension/slash-command": latest::zed::extension::slash_command,
},
});
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_3_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_3_0.rs
index 53aa65d5187..36c48779509 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_3_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_3_0.rs
@@ -19,17 +19,17 @@ wasmtime::component::bindgen!({
},
path: "../extension_api/wit/since_v0.3.0",
with: {
- "worktree": ExtensionWorktree,
- "project": ExtensionProject,
- "key-value-store": ExtensionKeyValueStore,
- "zed:extension/common": latest::zed::extension::common,
- "zed:extension/github": since_v0_6_0::zed::extension::github,
- "zed:extension/http-client": latest::zed::extension::http_client,
- "zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
- "zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
- "zed:extension/process": latest::zed::extension::process,
- "zed:extension/slash-command": latest::zed::extension::slash_command,
+ "worktree": ExtensionWorktree,
+ "project": ExtensionProject,
+ "key-value-store": ExtensionKeyValueStore,
+ "zed:extension/common": latest::zed::extension::common,
+ "zed:extension/github": since_v0_6_0::zed::extension::github,
+ "zed:extension/http-client": latest::zed::extension::http_client,
+ "zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
+ "zed:extension/nodejs": latest::zed::extension::nodejs,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
+ "zed:extension/process": latest::zed::extension::process,
+ "zed:extension/slash-command": latest::zed::extension::slash_command,
},
});
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_4_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_4_0.rs
index 44b7d7ba1ad..75ab8c2a019 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_4_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_4_0.rs
@@ -27,7 +27,7 @@ wasmtime::component::bindgen!({
"zed:extension/http-client": latest::zed::extension::http_client,
"zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
"zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
"zed:extension/process": latest::zed::extension::process,
"zed:extension/slash-command": latest::zed::extension::slash_command,
},
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_5_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_5_0.rs
index 4dff0d90a94..bfb75ee205d 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_5_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_5_0.rs
@@ -27,7 +27,7 @@ wasmtime::component::bindgen!({
"zed:extension/http-client": latest::zed::extension::http_client,
"zed:extension/lsp": since_v0_6_0::zed::extension::lsp,
"zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
+ "zed:extension/platform": since_v0_6_0::zed::extension::platform,
"zed:extension/process": latest::zed::extension::process,
"zed:extension/slash-command": latest::zed::extension::slash_command,
"zed:extension/context-server": latest::zed::extension::context_server,
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs
index 91d446e1637..76f93020be6 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_6_0.rs
@@ -26,7 +26,6 @@ wasmtime::component::bindgen!({
"zed:extension/common": latest::zed::extension::common,
"zed:extension/http-client": latest::zed::extension::http_client,
"zed:extension/nodejs": latest::zed::extension::nodejs,
- "zed:extension/platform": latest::zed::extension::platform,
"zed:extension/process": latest::zed::extension::process,
"zed:extension/slash-command": latest::zed::extension::slash_command,
"zed:extension/context-server": latest::zed::extension::context_server,
@@ -384,6 +383,33 @@ impl ExtensionImports for WasmState {
}
}
+impl From<latest::platform::Architecture> for platform::Architecture {
+ fn from(value: latest::platform::Architecture) -> Self {
+ match value {
+ latest::platform::Architecture::Aarch64 => Self::Aarch64,
+ latest::platform::Architecture::X8664 => Self::X8664,
+ }
+ }
+}
+
+impl From<latest::platform::Os> for platform::Os {
+ fn from(value: latest::platform::Os) -> Self {
+ match value {
+ latest::platform::Os::Linux => Self::Linux,
+ latest::platform::Os::Mac => Self::Mac,
+ latest::platform::Os::Windows => Self::Windows,
+ }
+ }
+}
+
+impl platform::Host for WasmState {
+ async fn current_platform(&mut self) -> Result<(platform::Os, platform::Architecture)> {
+ latest::platform::Host::current_platform(self)
+ .await
+ .map(|(os, arch)| (os.into(), arch.into()))
+ }
+}
+
impl From<dap::TcpArguments> for latest::dap::TcpArguments {
fn from(value: dap::TcpArguments) -> Self {
let [a, b, c, d] = std::net::Ipv4Addr::from_bits(value.host).octets();
diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
index 8da53ca638c..15e5ff94062 100644
--- a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
+++ b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs
@@ -865,13 +865,12 @@ impl platform::Host for WasmState {
"macos" => platform::Os::Mac,
"linux" => platform::Os::Linux,
"windows" => platform::Os::Windows,
- _ => panic!("unsupported os"),
+ _ => bail!("unsupported os"),
},
match env::consts::ARCH {
"aarch64" => platform::Architecture::Aarch64,
- "x86" => platform::Architecture::X86,
"x86_64" => platform::Architecture::X8664,
- _ => panic!("unsupported architecture"),
+ _ => bail!("unsupported architecture"),
},
))
}
diff --git a/extensions/test-extension/src/test_extension.rs b/extensions/test-extension/src/test_extension.rs
index 0b96f470386..5f4b62f8a38 100644
--- a/extensions/test-extension/src/test_extension.rs
+++ b/extensions/test-extension/src/test_extension.rs
@@ -83,7 +83,6 @@ impl TestExtension {
version = release.version,
arch = match arch {
zed::Architecture::Aarch64 => "aarch64",
- zed::Architecture::X86 => "x86",
zed::Architecture::X8664 => "x86_64",
},
os = match platform {