assistant: Show a message when no docs providers are available (#14207)
This PR updates the `/docs` slash command to show a message to more clearly indicate when there are no available docs providers. <img width="379" alt="Screenshot 2024-07-11 at 10 31 53 AM" src="https://github.com/zed-industries/zed/assets/1486634/d079f87c-4933-4da9-ad82-34dbfe6a284c"> Release Notes: - N/A
This commit is contained in:
parent
2727f55772
commit
45c54d189a
1 changed files with 8 additions and 0 deletions
|
@ -121,6 +121,14 @@ impl SlashCommand for DocsSlashCommand {
|
||||||
match args {
|
match args {
|
||||||
DocsSlashCommandArgs::NoProvider => {
|
DocsSlashCommandArgs::NoProvider => {
|
||||||
let providers = indexed_docs_registry.list_providers();
|
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
|
Ok(providers
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|provider| ArgumentCompletion {
|
.map(|provider| ArgumentCompletion {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue