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.

zed_extension_api: Bump to v0.1.0 (#16158)

Marshall Bowers98a2ab06863e
diff --git a/Cargo.lock b/Cargo.lock
index 7d0db339da6..8664b200484 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13964,7 +13964,7 @@ dependencies = [
[[package]]
name = "zed_extension_api"
-version = "0.0.7"
+version = "0.1.0"
dependencies = [
"serde",
"serde_json",
@@ -13976,7 +13976,7 @@ name = "zed_gleam"
version = "0.1.3"
dependencies = [
"html_to_markdown 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "zed_extension_api 0.0.7",
+ "zed_extension_api 0.1.0",
]
[[package]]
diff --git a/crates/extension/src/wasm_host/wit.rs b/crates/extension/src/wasm_host/wit.rs
index 6780e1b8b6c..11cf692a7c2 100644
--- a/crates/extension/src/wasm_host/wit.rs
+++ b/crates/extension/src/wasm_host/wit.rs
@@ -1,10 +1,10 @@
mod since_v0_0_1;
mod since_v0_0_4;
mod since_v0_0_6;
-mod since_v0_0_7;
+mod since_v0_1_0;
use indexed_docs::IndexedDocsDatabase;
use release_channel::ReleaseChannel;
-use since_v0_0_7 as latest;
+use since_v0_1_0 as latest;
use super::{wasm_engine, WasmState};
use anyhow::{anyhow, Context, Result};
@@ -56,7 +56,7 @@ pub fn wasm_api_version_range(release_channel: ReleaseChannel) -> RangeInclusive
}
pub enum Extension {
- V007(since_v0_0_7::Extension),
+ V010(since_v0_1_0::Extension),
V006(since_v0_0_6::Extension),
V004(since_v0_0_4::Extension),
V001(since_v0_0_1::Extension),
@@ -77,7 +77,7 @@ impl Extension {
latest::Extension::instantiate_async(store, &component, latest::linker())
.await
.context("failed to instantiate wasm extension")?;
- Ok((Self::V007(extension), instance))
+ Ok((Self::V010(extension), instance))
} else if version >= since_v0_0_6::MIN_VERSION {
let (extension, instance) = since_v0_0_6::Extension::instantiate_async(
store,
@@ -110,7 +110,7 @@ impl Extension {
pub async fn call_init_extension(&self, store: &mut Store<WasmState>) -> Result<()> {
match self {
- Extension::V007(ext) => ext.call_init_extension(store).await,
+ Extension::V010(ext) => ext.call_init_extension(store).await,
Extension::V006(ext) => ext.call_init_extension(store).await,
Extension::V004(ext) => ext.call_init_extension(store).await,
Extension::V001(ext) => ext.call_init_extension(store).await,
@@ -125,7 +125,7 @@ impl Extension {
resource: Resource<Arc<dyn LspAdapterDelegate>>,
) -> Result<Result<Command, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_language_server_command(store, &language_server_id.0, resource)
.await
}
@@ -152,7 +152,7 @@ impl Extension {
resource: Resource<Arc<dyn LspAdapterDelegate>>,
) -> Result<Result<Option<String>, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_language_server_initialization_options(
store,
&language_server_id.0,
@@ -190,7 +190,7 @@ impl Extension {
resource: Resource<Arc<dyn LspAdapterDelegate>>,
) -> Result<Result<Option<String>, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_language_server_workspace_configuration(
store,
&language_server_id.0,
@@ -217,7 +217,7 @@ impl Extension {
completions: Vec<latest::Completion>,
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_labels_for_completions(store, &language_server_id.0, &completions)
.await
}
@@ -241,7 +241,7 @@ impl Extension {
symbols: Vec<latest::Symbol>,
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_labels_for_symbols(store, &language_server_id.0, &symbols)
.await
}
@@ -265,7 +265,7 @@ impl Extension {
query: &str,
) -> Result<Result<Vec<SlashCommandArgumentCompletion>, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_complete_slash_command_argument(store, command, query)
.await
}
@@ -281,12 +281,12 @@ impl Extension {
resource: Option<Resource<Arc<dyn LspAdapterDelegate>>>,
) -> Result<Result<SlashCommandOutput, String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_run_slash_command(store, command, argument, resource)
.await
}
Extension::V001(_) | Extension::V004(_) | Extension::V006(_) => {
- Err(anyhow!("`run_slash_command` not available prior to v0.0.7"))
+ Err(anyhow!("`run_slash_command` not available prior to v0.1.0"))
}
}
}
@@ -299,12 +299,12 @@ impl Extension {
database: Resource<Arc<IndexedDocsDatabase>>,
) -> Result<Result<(), String>> {
match self {
- Extension::V007(ext) => {
+ Extension::V010(ext) => {
ext.call_index_docs(store, provider, package_name, database)
.await
}
Extension::V001(_) | Extension::V004(_) | Extension::V006(_) => {
- Err(anyhow!("`index_docs` not available prior to v0.0.7"))
+ Err(anyhow!("`index_docs` not available prior to v0.1.0"))
}
}
}
diff --git a/crates/extension/src/wasm_host/wit/since_v0_0_7.rs b/crates/extension/src/wasm_host/wit/since_v0_1_0.rs
similarity index 99%
rename from crates/extension/src/wasm_host/wit/since_v0_0_7.rs
rename to crates/extension/src/wasm_host/wit/since_v0_1_0.rs
index e5cf38c076c..53024bb4c19 100644
--- a/crates/extension/src/wasm_host/wit/since_v0_0_7.rs
+++ b/crates/extension/src/wasm_host/wit/since_v0_1_0.rs
@@ -28,7 +28,7 @@ pub const MAX_VERSION: SemanticVersion = SemanticVersion::new(0, 0, 7);
wasmtime::component::bindgen!({
async: true,
trappable_imports: true,
- path: "../extension_api/wit/since_v0.0.7",
+ path: "../extension_api/wit/since_v0.1.0",
with: {
"worktree": ExtensionWorktree,
"key-value-store": ExtensionKeyValueStore,
@@ -39,7 +39,7 @@ wasmtime::component::bindgen!({
pub use self::zed::extension::*;
mod settings {
- include!(concat!(env!("OUT_DIR"), "/since_v0.0.7/settings.rs"));
+ include!(concat!(env!("OUT_DIR"), "/since_v0.1.0/settings.rs"));
}
pub type ExtensionWorktree = Arc<dyn LspAdapterDelegate>;
diff --git a/crates/extension_api/Cargo.toml b/crates/extension_api/Cargo.toml
index f7714319907..dde0da4d402 100644
--- a/crates/extension_api/Cargo.toml
+++ b/crates/extension_api/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "zed_extension_api"
-version = "0.0.7"
+version = "0.1.0"
description = "APIs for creating Zed extensions in Rust"
repository = "https://github.com/zed-industries/zed"
documentation = "https://docs.rs/zed_extension_api"
@@ -8,6 +8,9 @@ keywords = ["zed", "extension"]
edition = "2021"
license = "Apache-2.0"
+# We'll publish v0.1.0 after the release on Wednesday (2024-08-14).
+publish = false
+
[lints]
workspace = true
diff --git a/crates/extension_api/README.md b/crates/extension_api/README.md
index 9a313e73271..d3ba5c1c3c1 100644
--- a/crates/extension_api/README.md
+++ b/crates/extension_api/README.md
@@ -23,7 +23,7 @@ need to set your `crate-type` accordingly:
```toml
[dependencies]
-zed_extension_api = "0.0.7"
+zed_extension_api = "0.1.0"
[lib]
crate-type = ["cdylib"]
@@ -63,7 +63,7 @@ Here is the compatibility of the `zed_extension_api` with versions of Zed:
| Zed version | `zed_extension_api` version |
| ----------- | --------------------------- |
-| `0.149.x` | `0.0.1` - `0.0.7` |
+| `0.149.x` | `0.0.1` - `0.1.0` |
| `0.131.x` | `0.0.1` - `0.0.6` |
| `0.130.x` | `0.0.1` - `0.0.5` |
| `0.129.x` | `0.0.1` - `0.0.4` |
diff --git a/crates/extension_api/src/extension_api.rs b/crates/extension_api/src/extension_api.rs
index ed5b0b22a07..09a24486ac8 100644
--- a/crates/extension_api/src/extension_api.rs
+++ b/crates/extension_api/src/extension_api.rs
@@ -179,7 +179,7 @@ mod wit {
wit_bindgen::generate!({
skip: ["init-extension"],
- path: "./wit/since_v0.0.7",
+ path: "./wit/since_v0.1.0",
});
}
diff --git a/crates/extension_api/src/settings.rs b/crates/extension_api/src/settings.rs
index 067e8a60db5..9dfb120adba 100644
--- a/crates/extension_api/src/settings.rs
+++ b/crates/extension_api/src/settings.rs
@@ -1,4 +1,4 @@
-#[path = "../wit/since_v0.0.7/settings.rs"]
+#[path = "../wit/since_v0.1.0/settings.rs"]
mod types;
use crate::{wit, Result, SettingsLocation, Worktree};
diff --git a/crates/extension_api/wit/since_v0.0.7/common.wit b/crates/extension_api/wit/since_v0.1.0/common.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/common.wit
rename to crates/extension_api/wit/since_v0.1.0/common.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/extension.wit b/crates/extension_api/wit/since_v0.1.0/extension.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/extension.wit
rename to crates/extension_api/wit/since_v0.1.0/extension.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/github.wit b/crates/extension_api/wit/since_v0.1.0/github.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/github.wit
rename to crates/extension_api/wit/since_v0.1.0/github.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/http-client.wit b/crates/extension_api/wit/since_v0.1.0/http-client.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/http-client.wit
rename to crates/extension_api/wit/since_v0.1.0/http-client.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/lsp.wit b/crates/extension_api/wit/since_v0.1.0/lsp.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/lsp.wit
rename to crates/extension_api/wit/since_v0.1.0/lsp.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/nodejs.wit b/crates/extension_api/wit/since_v0.1.0/nodejs.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/nodejs.wit
rename to crates/extension_api/wit/since_v0.1.0/nodejs.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/platform.wit b/crates/extension_api/wit/since_v0.1.0/platform.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/platform.wit
rename to crates/extension_api/wit/since_v0.1.0/platform.wit
diff --git a/crates/extension_api/wit/since_v0.0.7/settings.rs b/crates/extension_api/wit/since_v0.1.0/settings.rs
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/settings.rs
rename to crates/extension_api/wit/since_v0.1.0/settings.rs
diff --git a/crates/extension_api/wit/since_v0.0.7/slash-command.wit b/crates/extension_api/wit/since_v0.1.0/slash-command.wit
similarity index 100%
rename from crates/extension_api/wit/since_v0.0.7/slash-command.wit
rename to crates/extension_api/wit/since_v0.1.0/slash-command.wit