Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)

This commit is contained in:
Anthony Dresser
2019-09-24 21:36:17 -07:00
committed by GitHub
parent a29ae4d3b9
commit 6a6048d40f
541 changed files with 7045 additions and 7287 deletions

View File

@@ -12,7 +12,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { CompletionItem, completionKindFromString } from 'vs/editor/common/modes';
import { Position, IPosition } from 'vs/editor/common/core/position';
import * as aria from 'vs/base/browser/ui/aria/aria';
import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource, IDataBreakpoint } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource, IDataBreakpoint, IDebugSessionOptions } from 'vs/workbench/contrib/debug/common/debug';
import { Source } from 'vs/workbench/contrib/debug/common/debugSource';
import { mixin } from 'vs/base/common/objects';
import { Thread, ExpressionContainer, DebugModel } from 'vs/workbench/contrib/debug/common/debugModel';
@@ -43,6 +43,7 @@ export class DebugSession implements IDebugSession {
private _subId: string | undefined;
private raw: RawDebugSession | undefined;
private initialized = false;
private _options: IDebugSessionOptions;
private sources = new Map<string, Source>();
private threads = new Map<number, Thread>();
@@ -66,7 +67,7 @@ export class DebugSession implements IDebugSession {
private _configuration: { resolved: IConfig, unresolved: IConfig | undefined },
public root: IWorkspaceFolder,
private model: DebugModel,
private _parentSession: IDebugSession | undefined,
options: IDebugSessionOptions | undefined,
@IDebugService private readonly debugService: IDebugService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IWindowService private readonly windowService: IWindowService,
@@ -79,7 +80,12 @@ export class DebugSession implements IDebugSession {
@IOpenerService private readonly openerService: IOpenerService
) {
this.id = generateUuid();
this.repl = new ReplModel(this);
this._options = options || {};
if (this.hasSeparateRepl()) {
this.repl = new ReplModel();
} else {
this.repl = (this.parentSession as DebugSession).repl;
}
}
getId(): string {
@@ -103,7 +109,7 @@ export class DebugSession implements IDebugSession {
}
get parentSession(): IDebugSession | undefined {
return this._parentSession;
return this._options.parentSession;
}
setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig | undefined }) {
@@ -307,7 +313,7 @@ export class DebugSession implements IDebugSession {
data.set(breakpointsToSend[i].getId(), response.body.breakpoints[i]);
}
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
});
}
@@ -321,7 +327,7 @@ export class DebugSession implements IDebugSession {
for (let i = 0; i < fbpts.length; i++) {
data.set(fbpts[i].getId(), response.body.breakpoints[i]);
}
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
});
}
@@ -361,7 +367,7 @@ export class DebugSession implements IDebugSession {
for (let i = 0; i < dataBreakpoints.length; i++) {
data.set(dataBreakpoints[i].getId(), response.body.breakpoints[i]);
}
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
});
}
@@ -838,7 +844,7 @@ export class DebugSession implements IDebugSession {
}], false);
if (bps.length === 1) {
const data = new Map<string, DebugProtocol.Breakpoint>([[bps[0].getId(), event.body.breakpoint]]);
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
}
@@ -857,11 +863,11 @@ export class DebugSession implements IDebugSession {
event.body.breakpoint.column = undefined;
}
const data = new Map<string, DebugProtocol.Breakpoint>([[breakpoint.getId(), event.body.breakpoint]]);
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
if (functionBreakpoint) {
const data = new Map<string, DebugProtocol.Breakpoint>([[functionBreakpoint.getId(), event.body.breakpoint]]);
this.model.setBreakpointSessionData(this.getId(), data);
this.model.setBreakpointSessionData(this.getId(), this.capabilities, data);
}
}
}));
@@ -879,6 +885,7 @@ export class DebugSession implements IDebugSession {
this.rawListeners.push(this.raw.onDidExitAdapter(event => {
this.initialized = true;
this.model.setBreakpointSessionData(this.getId(), this.capabilities, undefined);
this._onDidEndAdapter.fire(event);
}));
}
@@ -954,13 +961,17 @@ export class DebugSession implements IDebugSession {
return this.repl.getReplElements();
}
hasSeparateRepl(): boolean {
return !this.parentSession || this._options.repl !== 'mergeWithParent';
}
removeReplExpressions(): void {
this.repl.removeReplExpressions();
this._onDidChangeREPLElements.fire();
}
async addReplExpression(stackFrame: IStackFrame | undefined, name: string): Promise<void> {
const expressionEvaluated = this.repl.addReplExpression(stackFrame, name);
const expressionEvaluated = this.repl.addReplExpression(this, stackFrame, name);
this._onDidChangeREPLElements.fire();
await expressionEvaluated;
this._onDidChangeREPLElements.fire();
@@ -974,7 +985,7 @@ export class DebugSession implements IDebugSession {
}
logToRepl(sev: severity, args: any[], frame?: { uri: URI, line: number, column: number }) {
this.repl.logToRepl(sev, args, frame);
this.repl.logToRepl(this, sev, args, frame);
this._onDidChangeREPLElements.fire();
}
}