Allow completing slash command arguments from extensions (#13240)
This PR extends the extension API with support for completing slash command arguments for slash commands defined in extensions. Release Notes: - N/A
This commit is contained in:
@@ -146,6 +146,21 @@ impl zed::Extension for GleamExtension {
|
||||
})
|
||||
}
|
||||
|
||||
fn complete_slash_command_argument(
|
||||
&self,
|
||||
command: SlashCommand,
|
||||
_query: String,
|
||||
) -> Result<Vec<String>, String> {
|
||||
match command.name.as_str() {
|
||||
"gleam-project" => Ok(vec![
|
||||
"apple".to_string(),
|
||||
"banana".to_string(),
|
||||
"cherry".to_string(),
|
||||
]),
|
||||
_ => Ok(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
||||
fn run_slash_command(
|
||||
&self,
|
||||
command: SlashCommand,
|
||||
|
||||
Reference in New Issue
Block a user