Skip to content

Commit

Permalink
Don't show empty debugger list when there isn't any debug config
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Zhukovskyi <[email protected]>
  • Loading branch information
vzhukovs committed Jan 14, 2020
1 parent 43e5025 commit a38a49f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export class QuickPickServiceImpl implements QuickPickService {
async show(elements: (string | QuickPickItem<Object>)[], options?: QuickPickOptions): Promise<Object | undefined> {
return new Promise<Object | undefined>(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) {
Expand Down
3 changes: 0 additions & 3 deletions packages/debug/src/browser/debug-configuration-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ export class DebugConfigurationManager {
}
const { languageId } = widget.editor.document;
const debuggers = await this.debug.getDebuggersForLanguage(languageId);
if (debuggers && debuggers.length === 0) {
return undefined;
}
return this.quickPick.show(debuggers.map(
({ label, type }) => ({ label, value: type }),
{ placeholder: 'Select Environment' })
Expand Down

0 comments on commit a38a49f

Please sign in to comment.