'use strict' ; import { QuickPickItem , window , QuickPickOptions , CancellationToken , commands } from 'vscode' ; export class Menu { constructor ( private items , private options ? ) { } async show ( token ? ) { const selectedItem = await window . showQuickPick ( this . items , this . options , token ) ; if ( selectedItem !== undefined ) { await commands . executeCommand ( selectedItem . command , ... ( selectedItem . args ?? [ ] ) ) ; } return selectedItem ; } } export interface MenuItem extends QuickPickItem { command : string ; args ? : any [ ] ; }