Fix slash command argument completion bugs (#16233)

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-08-14 19:36:55 +03:00 committed by GitHub
parent 6365000b68
commit 8df21f7bcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 67 additions and 27 deletions

View file

@ -182,6 +182,7 @@ impl SlashCommand for DocsSlashCommand {
label: item.clone().into(),
new_text: item.to_string(),
run_command: true,
replace_previous_arguments: false,
})
.collect()
}
@ -194,6 +195,7 @@ impl SlashCommand for DocsSlashCommand {
label: "No available docs providers.".into(),
new_text: String::new(),
run_command: false,
replace_previous_arguments: false,
}]);
}
@ -203,6 +205,7 @@ impl SlashCommand for DocsSlashCommand {
label: provider.to_string().into(),
new_text: provider.to_string(),
run_command: false,
replace_previous_arguments: false,
})
.collect())
}
@ -234,6 +237,7 @@ impl SlashCommand for DocsSlashCommand {
label: format!("{package_name} (unindexed)").into(),
new_text: format!("{package_name}"),
run_command: true,
replace_previous_arguments: false,
})
.collect::<Vec<_>>();
items.extend(workspace_crate_completions);
@ -247,6 +251,7 @@ impl SlashCommand for DocsSlashCommand {
.into(),
new_text: provider.to_string(),
run_command: false,
replace_previous_arguments: false,
}]);
}