提交 1f00f9df 编写于 作者: I isidor

debug: support launching multiple launch configs manually

fixes #14338
fixes #14498
上级 4fd511d9
......@@ -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 {
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册