Merge from vscode 966b87dd4013be1a9c06e2b8334522ec61905cc2 (#4696)

This commit is contained in:
Anthony Dresser
2019-03-26 11:43:38 -07:00
committed by GitHub
parent b1393ae615
commit 0d8ef9583b
268 changed files with 5947 additions and 3422 deletions

View File

@@ -168,7 +168,7 @@ export interface IDebugSession extends ITreeElement {
removeReplExpressions(): void;
addReplExpression(stackFrame: IStackFrame | undefined, name: string): Promise<void>;
appendToRepl(data: string | IExpression, severity: severity, source?: IReplElementSource): void;
logToRepl(sev: severity, args: any[], frame?: { uri: uri, line: number, column: number });
logToRepl(sev: severity, args: any[], frame?: { uri: uri, line: number, column: number }): void;
// session events
readonly onDidEndAdapter: Event<AdapterEndEvent>;
@@ -389,6 +389,7 @@ export interface IEvaluate {
}
export interface IDebugModel extends ITreeElement {
getSession(sessionId: string | undefined, includeInactive?: boolean): IDebugSession | undefined;
getSessions(includeInactive?: boolean): IDebugSession[];
getBreakpoints(filter?: { uri?: uri, lineNumber?: number, column?: number, enabledOnly?: boolean }): ReadonlyArray<IBreakpoint>;
areBreakpointsActivated(): boolean;
@@ -471,8 +472,8 @@ export interface ICompound {
export interface IDebugAdapter extends IDisposable {
readonly onError: Event<Error>;
readonly onExit: Event<number | null>;
onRequest(callback: (request: DebugProtocol.Request) => void);
onEvent(callback: (event: DebugProtocol.Event) => void);
onRequest(callback: (request: DebugProtocol.Request) => void): void;
onEvent(callback: (event: DebugProtocol.Event) => void): void;
startSession(): Promise<void>;
sendMessage(message: DebugProtocol.ProtocolMessage): void;
sendResponse(response: DebugProtocol.Response): void;

View File

@@ -81,7 +81,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC
if (resource.query) {
const data = Source.getEncodedDebugData(resource);
session = this.debugService.getModel().getSessions().filter(p => p.getId() === data.sessionId).pop();
session = this.debugService.getModel().getSession(data.sessionId);
}
if (!session) {

View File

@@ -778,6 +778,13 @@ export class DebugModel implements IDebugModel {
return 'root';
}
getSession(sessionId: string | undefined, includeInactive = false): IDebugSession | undefined {
if (sessionId) {
return this.getSessions(includeInactive).filter(s => s.getId() === sessionId).pop();
}
return undefined;
}
getSessions(includeInactive = false): IDebugSession[] {
// By default do not return inactive sesions.
// However we are still holding onto inactive sessions due to repl and debug service session revival (eh scenario)

View File

@@ -199,7 +199,7 @@ function convertPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePath: (toDA:
fixSourcePath(true, (<DebugProtocol.GotoTargetsArguments>request.arguments).source);
break;
case 'launchVSCode':
request.arguments.args.forEach(arg => fixSourcePath(false, arg));
request.arguments.args.forEach((arg: PathContainer | undefined) => fixSourcePath(false, arg));
break;
default:
break;