diff --git a/packages/core/src/browser/quick-open/quick-pick-service-impl.ts b/packages/core/src/browser/quick-open/quick-pick-service-impl.ts index 6c75605287ebb..42af42b56f1ac 100644 --- a/packages/core/src/browser/quick-open/quick-pick-service-impl.ts +++ b/packages/core/src/browser/quick-open/quick-pick-service-impl.ts @@ -38,6 +38,10 @@ export class QuickPickServiceImpl implements QuickPickService { async show(elements: (string | QuickPickItem)[], options?: QuickPickOptions): Promise { return new Promise(resolve => { this.items = this.toItems(elements, resolve); + if (this.items.length === 0) { + resolve(undefined); + return; + } // Set `runIfSingle` to the value passed through options, else defaults to true. const runIfSingle: boolean = (options && options.runIfSingle !== undefined) ? options.runIfSingle : true; if (runIfSingle && this.items.length === 1) {