From 37d2953669ffbca09e1049170a597d646090c1ff Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 8 Mar 2017 11:00:25 +0100 Subject: [PATCH] debug: sources should be a map of uri string to source fixes broken internal module fetching --- .../workbench/parts/debug/browser/debugContentProvider.ts | 2 +- src/vs/workbench/parts/debug/common/debug.ts | 2 +- src/vs/workbench/parts/debug/common/debugModel.ts | 6 +++--- .../workbench/parts/debug/electron-browser/debugService.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts index 95908ee601ec2..cf1f66113ca72 100644 --- a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts +++ b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts @@ -45,7 +45,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC if (!process) { return TPromise.wrapError(localize('unable', "Unable to resolve the resource without a debug session")); } - const source = process.sources.get(resource); + const source = process.sources.get(resource.toString()); const rawSource = source ? source.raw : { path: paths.normalize(resource.fsPath, true) }; return process.session.source({ sourceReference: source ? source.reference : undefined, source: rawSource }).then(response => { diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 1d78431a0a6b7..2475957480487 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -102,7 +102,7 @@ export interface IProcess extends ITreeElement { name: string; configuration: IConfig; session: ISession; - sources: Map; + sources: Map; isAttach(): boolean; getThread(threadId: number): IThread; getAllThreads(): IThread[]; diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index d8a99cc2becb2..b75180db4c5c8 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -449,7 +449,7 @@ export class Thread implements debug.IThread { return new StackFrame(this, 0, new Source({ name: UNKNOWN_SOURCE_LABEL }, true), nls.localize('unknownStack', "Unknown stack location"), null, null); } const source = rsf.source ? new Source(rsf.source, rsf.source.presentationHint === 'deemphasize') : new Source({ name: UNKNOWN_SOURCE_LABEL }, true); - this.process.sources.set(source.uri, source); + this.process.sources.set(source.uri.toString(), source); return new StackFrame(this, rsf.id, source, rsf.name, rsf.line, rsf.column); }); @@ -494,11 +494,11 @@ export class Thread implements debug.IThread { export class Process implements debug.IProcess { private threads: Map; - public sources: Map; + public sources: Map; constructor(public configuration: debug.IConfig, private _session: debug.ISession & debug.ITreeElement) { this.threads = new Map(); - this.sources = new Map(); + this.sources = new Map(); } public get session(): debug.ISession { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index d2194deca7d39..ba742cf22f01a 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -945,7 +945,7 @@ export class DebugService implements debug.IDebugService { const breakpointsToSend = distinct(this.model.getBreakpoints().filter(bp => this.model.areBreakpointsActivated() && bp.enabled && bp.uri.toString() === modelUri.toString()), bp => bp.lineNumber.toString()); - const source = process.sources.get(modelUri); + const source = process.sources.get(modelUri.toString()); const rawSource = source ? source.raw : { path: paths.normalize(modelUri.fsPath, true) }; return session.setBreakpoints({