extension: Make worktree
argument to run_slash_command
optional (#15658)
This PR updates the extension API to make the `worktree` argument to `run_slash_command` optional. We may not always have a worktree, and not all slash commands need them, so by making it optional we can allow individual slash commands to decide what to do when there is no worktree. Release Notes: - N/A
This commit is contained in:
parent
88f29c8355
commit
771424e4f9
5 changed files with 12 additions and 9 deletions
|
@ -125,7 +125,7 @@ pub trait Extension: Send + Sync {
|
|||
&self,
|
||||
_command: SlashCommand,
|
||||
_argument: Option<String>,
|
||||
_worktree: &Worktree,
|
||||
_worktree: Option<&Worktree>,
|
||||
) -> Result<SlashCommandOutput, String> {
|
||||
Err("`run_slash_command` not implemented".to_string())
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ impl wit::Guest for Component {
|
|||
fn run_slash_command(
|
||||
command: SlashCommand,
|
||||
argument: Option<String>,
|
||||
worktree: &Worktree,
|
||||
worktree: Option<&Worktree>,
|
||||
) -> Result<SlashCommandOutput, String> {
|
||||
extension().run_slash_command(command, argument, worktree)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue