feat(vscode-ide-companion): add Tab key fill-only behavior for completions (#2431)

* feat(vscode-ide-companion): add Tab key fill-only behavior for completions

- Separate Tab and Enter key handling in CompletionMenu
- Tab now inserts completion text without executing (useful for slash commands)
- Enter/click continues to select and execute immediately
- Allow users to append arguments after Tab-filling slash commands

* feat(vscode-ide-companion): add Tab key fill-only behavior for completions

- Separate Tab and Enter key handling in CompletionMenu
- Tab now inserts completion text without executing (useful for slash commands)
- Enter/click continues to select and execute immediately
- Allow users to append arguments after Tab-filling slash commands

Co-authored-by: Mingholy <14246397+Mingholy@users.noreply.github.com>

* feat: add command selection behavior logic and tests

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>

* feat(vscode-ide-companion): add Tab key completion fill behavior with tests

- Add onCompletionFill prop to InputForm for Tab key handling
- Distinguish Tab (fill) and Enter (select) completion behaviors
- Add keyboard handling tests for completion items
- Remove 'skills' command from non-interactive CLI allowed list

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* refactor: add itemId variable for command handling in App component

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>

* refactor: remove unused command selection behavior utils and tests

---------

Co-authored-by: Mingholy <14246397+Mingholy@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
易良 2026-03-18 21:45:11 +08:00 committed by GitHub
parent 28148d36c3
commit ef640ba698
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 186 additions and 11 deletions

View file

@ -111,8 +111,10 @@ export interface InputFormProps {
completionIsOpen: boolean;
/** Completion items */
completionItems?: CompletionItem[];
/** Completion select callback */
/** Completion select callback (Enter / click) */
onCompletionSelect?: (item: CompletionItem) => void;
/** Completion fill callback (Tab — fill without executing). Falls back to onCompletionSelect. */
onCompletionFill?: (item: CompletionItem) => void;
/** Completion close callback */
onCompletionClose?: () => void;
/** Placeholder text */
@ -170,6 +172,7 @@ export const InputForm: FC<InputFormProps> = ({
completionIsOpen,
completionItems,
onCompletionSelect,
onCompletionFill,
onCompletionClose,
placeholder = 'Ask Qwen Code …',
}) => {
@ -242,6 +245,7 @@ export const InputForm: FC<InputFormProps> = ({
<CompletionMenu
items={completionItemsResolved}
onSelect={onCompletionSelect}
onFill={onCompletionFill}
onClose={onCompletionClose}
title={undefined}
/>