提交 c9676af8 编写于 作者: I isidor

debug: only automatically reveal repl on debug session start

fixes #2467
上级 c0f57381
......@@ -267,7 +267,7 @@ export interface IDebugService extends ee.IEventEmitter {
getViewModel(): IViewModel;
openOrRevealEditor(source: Source, lineNumber: number, preserveFocus: boolean, sideBySide: boolean): TPromise<any>;
revealRepl(inBackground?:boolean): TPromise<void>;
revealRepl(focus?: boolean): TPromise<void>;
}
// utils
......
......@@ -219,9 +219,6 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
if (simpleVals.length) {
this.logToRepl(simpleVals.join(' '), sev);
}
// show repl
this.revealRepl(true /* in background */).done(null, errors.onUnexpectedError);
}
}
......@@ -316,7 +313,6 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
private onOutput(event: DebugProtocol.OutputEvent): void {
const outputSeverity = event.body.category === 'stderr' ? severity.Error : event.body.category === 'console' ? severity.Warning : severity.Info;
this.appendReplOutput(event.body.output, outputSeverity);
this.revealRepl(true /* in background */).done(null, errors.onUnexpectedError);
}
private getThreadData(threadId: number): TPromise<void> {
......@@ -564,6 +560,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
glyphMargin: true
});
this.inDebugMode.set(true);
this.revealRepl(false).done(undefined, errors.onUnexpectedError);
this.telemetryService.publicLog('debugSessionStart', { type: configuration.type, breakpointCount: this.model.getBreakpoints().length, exceptionBreakpoints: this.model.getExceptionBreakpoints() });
}).then(undefined, (error: Error) => {
......@@ -754,10 +751,10 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return this.editorService.openEditor(editorInput, wbeditorcommon.TextEditorOptions.create({ preserveFocus: true }), sideBySide);
}
public revealRepl(inBackground: boolean = false): TPromise<void> {
return this.panelService.openPanel(debug.REPL_ID, !inBackground).then((repl: Repl) => {
public revealRepl(focus = true): TPromise<void> {
return this.panelService.openPanel(debug.REPL_ID, focus).then((repl: Repl) => {
const elements = this.model.getReplElements();
if (!inBackground && elements.length > 0) {
if (elements.length > 0) {
return repl.reveal(elements[elements.length - 1]);
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册