Skip to content

Commit

Permalink
debug: support launching multiple launch configs manually
Browse files Browse the repository at this point in the history
fixes #14338
fixes #14498
  • Loading branch information
isidorn committed Nov 3, 2016
1 parent 4fd511d commit 1f00f9d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/vs/workbench/parts/debug/browser/debugActions.ts
Expand Up @@ -104,10 +104,6 @@ export class SelectConfigAction extends AbstractDebugAction {
this.debugService.getViewModel().setSelectedConfigurationName(configName);
return TPromise.as(null);
}

protected isEnabled(state: debug.State): boolean {
return super.isEnabled(state) && state === debug.State.Inactive;
}
}

export class StartAction extends AbstractDebugAction {
Expand All @@ -116,14 +112,19 @@ export class StartAction extends AbstractDebugAction {

constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, @ICommandService private commandService: ICommandService) {
super(id, label, 'debug-action start', debugService, keybindingService);
this.debugService.getViewModel().onDidSelectConfigurationName(() => {
this.updateEnablement();
});
}

public run(): TPromise<any> {
return this.commandService.executeCommand('_workbench.startDebug', this.debugService.getViewModel().selectedConfigurationName);
}

// Disabled if the launch drop down shows the launch config that is already running.
protected isEnabled(state: debug.State): boolean {
return super.isEnabled(state) && state === debug.State.Inactive;
const process = this.debugService.getModel().getProcesses();
return super.isEnabled(state) && process.every(p => p.name !== this.debugService.getViewModel().selectedConfigurationName);
}
}

Expand Down

0 comments on commit 1f00f9d

Please sign in to comment.