feat: auto-execute on slash command completion functions (#14584)

This commit is contained in:
Jack Wotherspoon
2025-12-08 16:32:39 -05:00
committed by GitHub
parent 17b5b40765
commit 89570aef06
9 changed files with 197 additions and 8 deletions

View File

@@ -51,6 +51,8 @@ export interface UseCommandCompletionReturn {
getCommandFromSuggestion: (
suggestion: Suggestion,
) => SlashCommand | undefined;
isArgumentCompletion: boolean;
leafCommand: SlashCommand | null;
};
getCompletedText: (suggestion: Suggestion) => string | null;
}

View File

@@ -419,6 +419,8 @@ export function useSlashCompletion(props: UseSlashCompletionProps): {
getCommandFromSuggestion: (
suggestion: Suggestion,
) => SlashCommand | undefined;
isArgumentCompletion: boolean;
leafCommand: SlashCommand | null;
} {
const {
enabled,
@@ -568,5 +570,7 @@ export function useSlashCompletion(props: UseSlashCompletionProps): {
completionEnd,
getCommandFromSuggestion: (suggestion: Suggestion) =>
getCommandFromSuggestion(suggestion, parserResult),
isArgumentCompletion: parserResult.isArgumentCompletion,
leafCommand: parserResult.leafCommand,
};
}