Skip to content

Commit 3ba047f

Browse files
committed
1 parent b789f6c commit 3ba047f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class ConfigurationManager implements IConfigurationManager {
346346
private setCompoundSchemaValues(): void {
347347
const compoundConfigurationsSchema = (<IJSONSchema>launchSchema.properties!['compounds'].items).properties!['configurations'];
348348
const launchNames = this.launches.map(l =>
349-
l.getConfigurationNames(false)).reduce((first, second) => first.concat(second), []);
349+
l.getConfigurationNames(true)).reduce((first, second) => first.concat(second), []);
350350
(<IJSONSchema>compoundConfigurationsSchema.items).oneOf![0].enum = launchNames;
351351
(<IJSONSchema>compoundConfigurationsSchema.items).oneOf![1].properties!.name.enum = launchNames;
352352

@@ -523,7 +523,7 @@ abstract class AbstractLaunch {
523523
return config.compounds.filter(compound => compound.name === name).pop();
524524
}
525525

526-
getConfigurationNames(includeCompounds = true): string[] {
526+
getConfigurationNames(ignoreCompoundsAndPresentation = false): string[] {
527527
const config = this.getConfig();
528528
if (!config || (!Array.isArray(config.configurations) && !Array.isArray(config.compounds))) {
529529
return [];
@@ -532,12 +532,14 @@ abstract class AbstractLaunch {
532532
if (config.configurations) {
533533
configurations.push(...config.configurations.filter(cfg => cfg && typeof cfg.name === 'string'));
534534
}
535-
if (includeCompounds && config.compounds) {
536-
if (config.compounds) {
537-
configurations.push(...config.compounds.filter(compound => typeof compound.name === 'string' && compound.configurations && compound.configurations.length));
538-
}
535+
536+
if (ignoreCompoundsAndPresentation) {
537+
return configurations.map(c => c.name);
539538
}
540539

540+
if (config.compounds) {
541+
configurations.push(...config.compounds.filter(compound => typeof compound.name === 'string' && compound.configurations && compound.configurations.length));
542+
}
541543
return getVisibleAndSorted(configurations).map(c => c.name);
542544
}
543545
}

src/vs/workbench/contrib/debug/common/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ export interface ILaunch {
710710
* Returns the names of all configurations and compounds.
711711
* Ignores configurations which are invalid.
712712
*/
713-
getConfigurationNames(includeCompounds?: boolean): string[];
713+
getConfigurationNames(ignoreCompoundsAndPresentation?: boolean): string[];
714714

715715
/**
716716
* Opens the launch.json file. Creates if it does not exist.

0 commit comments

Comments
 (0)