zed_extension_api: Bump to v0.1.0 (#16158)
This PR changes v0.0.7 of the extension API to v0.1.0. We had a false-start in releasing v0.0.7, which has since been yanked, so we need a new version number. We'll publish v0.1.0 to crates.io once the Preview build is out tomorrow. We're incrementing the minor version so that we have some leeway in putting out patch releases of the crate within a given extension API release. Release Notes: - N/A
This commit is contained in:
parent
47eed12f77
commit
98a2ab0686
16 changed files with 27 additions and 24 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -13964,7 +13964,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zed_extension_api"
|
name = "zed_extension_api"
|
||||||
version = "0.0.7"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -13976,7 +13976,7 @@ name = "zed_gleam"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"html_to_markdown 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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]]
|
[[package]]
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
mod since_v0_0_1;
|
mod since_v0_0_1;
|
||||||
mod since_v0_0_4;
|
mod since_v0_0_4;
|
||||||
mod since_v0_0_6;
|
mod since_v0_0_6;
|
||||||
mod since_v0_0_7;
|
mod since_v0_1_0;
|
||||||
use indexed_docs::IndexedDocsDatabase;
|
use indexed_docs::IndexedDocsDatabase;
|
||||||
use release_channel::ReleaseChannel;
|
use release_channel::ReleaseChannel;
|
||||||
use since_v0_0_7 as latest;
|
use since_v0_1_0 as latest;
|
||||||
|
|
||||||
use super::{wasm_engine, WasmState};
|
use super::{wasm_engine, WasmState};
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
|
@ -56,7 +56,7 @@ pub fn wasm_api_version_range(release_channel: ReleaseChannel) -> RangeInclusive
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum Extension {
|
pub enum Extension {
|
||||||
V007(since_v0_0_7::Extension),
|
V010(since_v0_1_0::Extension),
|
||||||
V006(since_v0_0_6::Extension),
|
V006(since_v0_0_6::Extension),
|
||||||
V004(since_v0_0_4::Extension),
|
V004(since_v0_0_4::Extension),
|
||||||
V001(since_v0_0_1::Extension),
|
V001(since_v0_0_1::Extension),
|
||||||
|
@ -77,7 +77,7 @@ impl Extension {
|
||||||
latest::Extension::instantiate_async(store, &component, latest::linker())
|
latest::Extension::instantiate_async(store, &component, latest::linker())
|
||||||
.await
|
.await
|
||||||
.context("failed to instantiate wasm extension")?;
|
.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 {
|
} else if version >= since_v0_0_6::MIN_VERSION {
|
||||||
let (extension, instance) = since_v0_0_6::Extension::instantiate_async(
|
let (extension, instance) = since_v0_0_6::Extension::instantiate_async(
|
||||||
store,
|
store,
|
||||||
|
@ -110,7 +110,7 @@ impl Extension {
|
||||||
|
|
||||||
pub async fn call_init_extension(&self, store: &mut Store<WasmState>) -> Result<()> {
|
pub async fn call_init_extension(&self, store: &mut Store<WasmState>) -> Result<()> {
|
||||||
match self {
|
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::V006(ext) => ext.call_init_extension(store).await,
|
||||||
Extension::V004(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,
|
Extension::V001(ext) => ext.call_init_extension(store).await,
|
||||||
|
@ -125,7 +125,7 @@ impl Extension {
|
||||||
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
||||||
) -> Result<Result<Command, String>> {
|
) -> Result<Result<Command, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_language_server_command(store, &language_server_id.0, resource)
|
ext.call_language_server_command(store, &language_server_id.0, resource)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ impl Extension {
|
||||||
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
||||||
) -> Result<Result<Option<String>, String>> {
|
) -> Result<Result<Option<String>, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_language_server_initialization_options(
|
ext.call_language_server_initialization_options(
|
||||||
store,
|
store,
|
||||||
&language_server_id.0,
|
&language_server_id.0,
|
||||||
|
@ -190,7 +190,7 @@ impl Extension {
|
||||||
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
resource: Resource<Arc<dyn LspAdapterDelegate>>,
|
||||||
) -> Result<Result<Option<String>, String>> {
|
) -> Result<Result<Option<String>, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_language_server_workspace_configuration(
|
ext.call_language_server_workspace_configuration(
|
||||||
store,
|
store,
|
||||||
&language_server_id.0,
|
&language_server_id.0,
|
||||||
|
@ -217,7 +217,7 @@ impl Extension {
|
||||||
completions: Vec<latest::Completion>,
|
completions: Vec<latest::Completion>,
|
||||||
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
|
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_labels_for_completions(store, &language_server_id.0, &completions)
|
ext.call_labels_for_completions(store, &language_server_id.0, &completions)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ impl Extension {
|
||||||
symbols: Vec<latest::Symbol>,
|
symbols: Vec<latest::Symbol>,
|
||||||
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
|
) -> Result<Result<Vec<Option<CodeLabel>>, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_labels_for_symbols(store, &language_server_id.0, &symbols)
|
ext.call_labels_for_symbols(store, &language_server_id.0, &symbols)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ impl Extension {
|
||||||
query: &str,
|
query: &str,
|
||||||
) -> Result<Result<Vec<SlashCommandArgumentCompletion>, String>> {
|
) -> Result<Result<Vec<SlashCommandArgumentCompletion>, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_complete_slash_command_argument(store, command, query)
|
ext.call_complete_slash_command_argument(store, command, query)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -281,12 +281,12 @@ impl Extension {
|
||||||
resource: Option<Resource<Arc<dyn LspAdapterDelegate>>>,
|
resource: Option<Resource<Arc<dyn LspAdapterDelegate>>>,
|
||||||
) -> Result<Result<SlashCommandOutput, String>> {
|
) -> Result<Result<SlashCommandOutput, String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_run_slash_command(store, command, argument, resource)
|
ext.call_run_slash_command(store, command, argument, resource)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
Extension::V001(_) | Extension::V004(_) | Extension::V006(_) => {
|
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>>,
|
database: Resource<Arc<IndexedDocsDatabase>>,
|
||||||
) -> Result<Result<(), String>> {
|
) -> Result<Result<(), String>> {
|
||||||
match self {
|
match self {
|
||||||
Extension::V007(ext) => {
|
Extension::V010(ext) => {
|
||||||
ext.call_index_docs(store, provider, package_name, database)
|
ext.call_index_docs(store, provider, package_name, database)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
Extension::V001(_) | Extension::V004(_) | Extension::V006(_) => {
|
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"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub const MAX_VERSION: SemanticVersion = SemanticVersion::new(0, 0, 7);
|
||||||
wasmtime::component::bindgen!({
|
wasmtime::component::bindgen!({
|
||||||
async: true,
|
async: true,
|
||||||
trappable_imports: true,
|
trappable_imports: true,
|
||||||
path: "../extension_api/wit/since_v0.0.7",
|
path: "../extension_api/wit/since_v0.1.0",
|
||||||
with: {
|
with: {
|
||||||
"worktree": ExtensionWorktree,
|
"worktree": ExtensionWorktree,
|
||||||
"key-value-store": ExtensionKeyValueStore,
|
"key-value-store": ExtensionKeyValueStore,
|
||||||
|
@ -39,7 +39,7 @@ wasmtime::component::bindgen!({
|
||||||
pub use self::zed::extension::*;
|
pub use self::zed::extension::*;
|
||||||
|
|
||||||
mod settings {
|
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>;
|
pub type ExtensionWorktree = Arc<dyn LspAdapterDelegate>;
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "zed_extension_api"
|
name = "zed_extension_api"
|
||||||
version = "0.0.7"
|
version = "0.1.0"
|
||||||
description = "APIs for creating Zed extensions in Rust"
|
description = "APIs for creating Zed extensions in Rust"
|
||||||
repository = "https://github.com/zed-industries/zed"
|
repository = "https://github.com/zed-industries/zed"
|
||||||
documentation = "https://docs.rs/zed_extension_api"
|
documentation = "https://docs.rs/zed_extension_api"
|
||||||
|
@ -8,6 +8,9 @@ keywords = ["zed", "extension"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
||||||
|
# We'll publish v0.1.0 after the release on Wednesday (2024-08-14).
|
||||||
|
publish = false
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ need to set your `crate-type` accordingly:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zed_extension_api = "0.0.7"
|
zed_extension_api = "0.1.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
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 |
|
| 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.131.x` | `0.0.1` - `0.0.6` |
|
||||||
| `0.130.x` | `0.0.1` - `0.0.5` |
|
| `0.130.x` | `0.0.1` - `0.0.5` |
|
||||||
| `0.129.x` | `0.0.1` - `0.0.4` |
|
| `0.129.x` | `0.0.1` - `0.0.4` |
|
||||||
|
|
|
@ -179,7 +179,7 @@ mod wit {
|
||||||
|
|
||||||
wit_bindgen::generate!({
|
wit_bindgen::generate!({
|
||||||
skip: ["init-extension"],
|
skip: ["init-extension"],
|
||||||
path: "./wit/since_v0.0.7",
|
path: "./wit/since_v0.1.0",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#[path = "../wit/since_v0.0.7/settings.rs"]
|
#[path = "../wit/since_v0.1.0/settings.rs"]
|
||||||
mod types;
|
mod types;
|
||||||
|
|
||||||
use crate::{wit, Result, SettingsLocation, Worktree};
|
use crate::{wit, Result, SettingsLocation, Worktree};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue