Skip to content

Commit

Permalink
sample: QuickInput Internal Test
Browse files Browse the repository at this point in the history
This commit adds an internal test that create a QuickPick menu.

Signed-Off-By: FernandoAscencio <[email protected]>
  • Loading branch information
FernandoAscencio committed Feb 22, 2023
1 parent 0c505a4 commit 7fdc787
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/api-samples/src/browser/menu/sample-menu-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ export class SampleCommandContribution implements CommandContribution {
protected readonly messageService: MessageService;

registerCommands(commands: CommandRegistry): void {
commands.registerCommand({ id: 'create-quick-pick-sample', label: 'Internal QuickPick' }, {
execute: () => {
const pick = this.quickInputService.createQuickPick();
pick.items = [{ label: '1' }, { label: '2' }, { label: '3' }];
pick.onDidAccept(() => {
console.log(`accepted: ${pick.selectedItems[0]?.label}`);
pick.hide();
});
pick.show();
}
});
commands.registerCommand(SampleCommand, {
execute: () => {
alert('This is a sample command!');
Expand Down

0 comments on commit 7fdc787

Please sign in to comment.