From 931883aca977a1651ac072c61903b47dad1768ee Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 15 Aug 2024 13:25:55 -0400 Subject: [PATCH] extension: Remove `tooltip_text` from `SlashCommandManifestEntry` (#16306) This PR removes the `tooltip_text` field from `SlashCommandManifestEntry`s. The `tooltip_text` is currently only used to set the `menu_text` on a slash command, which is only used for featured slash commands. Since slash commands from extensions are not currently able to be featured, we don't need extension authors to provide this field in the manifest. This is a backwards-compatible change. Release Notes: - N/A --- crates/extension/src/extension_manifest.rs | 1 - crates/extension/src/extension_store.rs | 5 ++++- docs/src/extensions/slash-commands.md | 3 --- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/extension/src/extension_manifest.rs b/crates/extension/src/extension_manifest.rs index 24a2782c3dd8b729d95f9f0d4fa8313c85aa2a01..9d8a841686feb5c760d5fb0a01b97380d732bf41 100644 --- a/crates/extension/src/extension_manifest.rs +++ b/crates/extension/src/extension_manifest.rs @@ -137,7 +137,6 @@ impl LanguageServerManifestEntry { #[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)] pub struct SlashCommandManifestEntry { pub description: String, - pub tooltip_text: String, pub requires_argument: bool, } diff --git a/crates/extension/src/extension_store.rs b/crates/extension/src/extension_store.rs index 41e269f9a075597d83e2dcdde581b3c061605227..35ee7747d909fff081d1513e92a231e448b2966b 100644 --- a/crates/extension/src/extension_store.rs +++ b/crates/extension/src/extension_store.rs @@ -1216,7 +1216,10 @@ impl ExtensionStore { command: crate::wit::SlashCommand { name: slash_command_name.to_string(), description: slash_command.description.to_string(), - tooltip_text: slash_command.tooltip_text.to_string(), + // We don't currently expose this as a configurable option, as it currently drives + // the `menu_text` on the `SlashCommand` trait, which is not used for slash commands + // defined in extensions, as they are not able to be added to the menu. + tooltip_text: String::new(), requires_argument: slash_command.requires_argument, }, extension: wasm_extension.clone(), diff --git a/docs/src/extensions/slash-commands.md b/docs/src/extensions/slash-commands.md index 3e1813d70c67e9f0a1fab026a8967ebf903c527a..f9cf076f88f00cd70abbc7a016b033282b1dd75e 100644 --- a/docs/src/extensions/slash-commands.md +++ b/docs/src/extensions/slash-commands.md @@ -18,19 +18,16 @@ For example, here is an extension that provides two slash commands: `/echo` and [slash_commands.echo] description = "echoes the provided input" requires_argument = true -tooltip_text = "" [slash_commands.pick-one] description = "pick one of three options" requires_argument = true -tooltip_text = "" ``` Each slash command may define the following properties: - `description`: A description of the slash command that will be shown when completing available commands. - `requires_argument`: Indicates whether a slash command requires at least one argument to run. -- `tooltip_text`: Currently unused. ## Implementing slash command behavior