diff --git a/crates/assistant/src/slash_command/docs_command.rs b/crates/assistant/src/slash_command/docs_command.rs index 075542f745..8a528249bb 100644 --- a/crates/assistant/src/slash_command/docs_command.rs +++ b/crates/assistant/src/slash_command/docs_command.rs @@ -276,6 +276,15 @@ impl SlashCommand for DocsSlashCommand { } => (provider, item_path), }; + if key.trim().is_empty() { + let package_term = match provider.as_ref() { + "docs-rs" | "rustdoc" => "crate", + _ => "package", + }; + + bail!("no {package_term} name provided"); + } + let store = store?; if let Some(package) = args.package() {