Skip to content

Commit

Permalink
debug: sources should be a map of uri string to source
Browse files Browse the repository at this point in the history
fixes broken internal module fetching
  • Loading branch information
isidorn committed Mar 8, 2017
1 parent 718b163 commit 37d2953
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/parts/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface IProcess extends ITreeElement {
name: string;
configuration: IConfig;
session: ISession;
sources: Map<uri, Source>;
sources: Map<string, Source>;
isAttach(): boolean;
getThread(threadId: number): IThread;
getAllThreads(): IThread[];
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/parts/debug/common/debugModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -494,11 +494,11 @@ export class Thread implements debug.IThread {
export class Process implements debug.IProcess {

private threads: Map<number, Thread>;
public sources: Map<uri, Source>;
public sources: Map<string, Source>;

constructor(public configuration: debug.IConfig, private _session: debug.ISession & debug.ITreeElement) {
this.threads = new Map<number, Thread>();
this.sources = new Map<uri, Source>();
this.sources = new Map<string, Source>();
}

public get session(): debug.ISession {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 37d2953

Please sign in to comment.