提交 fb9cabad 编写于 作者: I isidor

debug: notification on configure action if debugging is not setup

fixes #4453
上级 b2bb5b36
......@@ -70,7 +70,7 @@ export class SelectConfigActionItem extends BaseActionItem {
if (!config || !config.configurations) {
this.select.add(this.createOption(`<${ nls.localize('none', "none") }>`));
this.select.disabled = true;
return;
return this.actionRunner.run(this._action, null);
}
const configurations = config.configurations;
......
......@@ -19,7 +19,7 @@
background: url('repl.svg') center center no-repeat;
}
.monaco-workbench .debug-action.toggle-repl.notification:before {
.monaco-workbench .debug-action.notification:before {
content: '';
width: 6px;
height: 6px;
......
......@@ -145,7 +145,8 @@ export var ViewModelEvents = {
export var ServiceEvents = {
STATE_CHANGED: 'StateChanged',
TYPE_NOT_SUPPORTED: 'TypeNotSupported'
TYPE_NOT_SUPPORTED: 'TypeNotSupported',
CONFIGURATION_CHANGED: 'ConfigurationChanged'
};
export var SessionEvents = {
......
......@@ -79,7 +79,10 @@ export class ConfigureAction extends AbstractDebugAction {
static LABEL = nls.localize('openLaunchJson', "Open {0}", 'launch.json');
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action configure', debugService, keybindingService);
super(id, label, 'debug-action configure notification', debugService, keybindingService);
this.toDispose.push(debugService.addListener2(debug.ServiceEvents.CONFIGURATION_CHANGED, e => {
this.class = this.debugService.getConfigurationName() ? 'debug-action configure' : 'debug-action configure notification';
}));
}
public run(event?: any): TPromise<any> {
......
......@@ -525,7 +525,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
public createSession(noDebug: boolean, changeViewState = !this.partService.isSideBarHidden()): TPromise<any> {
this.clearReplExpressions();
return this.textFileService.saveAll().then(() => this.extensionService.onReady()).then(() => this.configurationManager.setConfiguration(this.configurationManager.getConfigurationName())).then(() => {
return this.textFileService.saveAll().then(() => this.extensionService.onReady()).then(() => this.setConfiguration(this.configurationManager.getConfigurationName())).then(() => {
const configuration = this.configurationManager.getConfiguration();
if (!configuration) {
......@@ -831,7 +831,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}
public setConfiguration(name: string): TPromise<void> {
return this.configurationManager.setConfiguration(name);
return this.configurationManager.setConfiguration(name).then(() => this.emit(debug.ServiceEvents.CONFIGURATION_CHANGED));
}
public openConfigFile(sideBySide: boolean): TPromise<boolean> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册