zed_extension_api: Bump to v0.1.0 (#16158)

Marshall Bowers created

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

Change summary

Cargo.lock                                              |  4 
crates/extension/src/wasm_host/wit.rs                   | 30 +++++-----
crates/extension/src/wasm_host/wit/since_v0_1_0.rs      |  4 
crates/extension_api/Cargo.toml                         |  5 +
crates/extension_api/README.md                          |  4 
crates/extension_api/src/extension_api.rs               |  2 
crates/extension_api/src/settings.rs                    |  2 
crates/extension_api/wit/since_v0.1.0/common.wit        |  0 
crates/extension_api/wit/since_v0.1.0/extension.wit     |  0 
crates/extension_api/wit/since_v0.1.0/github.wit        |  0 
crates/extension_api/wit/since_v0.1.0/http-client.wit   |  0 
crates/extension_api/wit/since_v0.1.0/lsp.wit           |  0 
crates/extension_api/wit/since_v0.1.0/nodejs.wit        |  0 
crates/extension_api/wit/since_v0.1.0/platform.wit      |  0 
crates/extension_api/wit/since_v0.1.0/settings.rs       |  0 
crates/extension_api/wit/since_v0.1.0/slash-command.wit |  0 
16 files changed, 27 insertions(+), 24 deletions(-)

Detailed changes

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]]

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"))
             }
         }
     }

crates/extension/src/wasm_host/wit/since_v0_0_7.rs → 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>;

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
 

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`           |

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};