From 45c54d189a5380524b46de622e7c7657f02f1993 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 11 Jul 2024 10:49:13 -0400 Subject: [PATCH] assistant: Show a message when no docs providers are available (#14207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates the `/docs` slash command to show a message to more clearly indicate when there are no available docs providers. Screenshot 2024-07-11 at 10 31 53 AM Release Notes: - N/A --- crates/assistant/src/slash_command/docs_command.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/assistant/src/slash_command/docs_command.rs b/crates/assistant/src/slash_command/docs_command.rs index c7e90edfd707ad3541230b367f6d2076ccf38daf..53b02eb128e649a1097a3b6069f681175e212bc7 100644 --- a/crates/assistant/src/slash_command/docs_command.rs +++ b/crates/assistant/src/slash_command/docs_command.rs @@ -121,6 +121,14 @@ impl SlashCommand for DocsSlashCommand { match args { DocsSlashCommandArgs::NoProvider => { let providers = indexed_docs_registry.list_providers(); + if providers.is_empty() { + return Ok(vec![ArgumentCompletion { + label: "No available docs providers.".to_string(), + new_text: String::new(), + run_command: false, + }]); + } + Ok(providers .into_iter() .map(|provider| ArgumentCompletion {