mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 04:44:30 +00:00
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]]
|
||||
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]]
|
||||
|
|
|
@ -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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>;
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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` |
|
||||
|
|
|
@ -179,7 +179,7 @@ mod wit {
|
|||
|
||||
wit_bindgen::generate!({
|
||||
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;
|
||||
|
||||
use crate::{wit, Result, SettingsLocation, Worktree};
|
||||
|
|
Loading…
Reference in a new issue