提交 4d3cfdc4 编写于 作者: I isidor

debug: open deemphesize sources. Also keep track of the same instance of a source object in the map

fixes #21941
上级 64a63c1c
...@@ -367,7 +367,7 @@ export class StackFrame implements debug.IStackFrame { ...@@ -367,7 +367,7 @@ export class StackFrame implements debug.IStackFrame {
} }
public openInEditor(editorService: IWorkbenchEditorService, preserveFocus?: boolean, sideBySide?: boolean): TPromise<any> { public openInEditor(editorService: IWorkbenchEditorService, preserveFocus?: boolean, sideBySide?: boolean): TPromise<any> {
return this.source.deemphasize ? TPromise.as(true) : editorService.openEditor({ return editorService.openEditor({
resource: this.source.uri, resource: this.source.uri,
description: this.source.origin, description: this.source.origin,
options: { options: {
...@@ -448,8 +448,12 @@ export class Thread implements debug.IThread { ...@@ -448,8 +448,12 @@ export class Thread implements debug.IThread {
if (!rsf) { if (!rsf) {
return new StackFrame(this, 0, new Source({ name: UNKNOWN_SOURCE_LABEL }, true), nls.localize('unknownStack', "Unknown stack location"), null, null); 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); let source = rsf.source ? new Source(rsf.source, rsf.source.presentationHint === 'deemphasize') : new Source({ name: UNKNOWN_SOURCE_LABEL }, true);
this.process.sources.set(source.uri.toString(), source); if (this.process.sources.has(source.uri.toString())) {
source = this.process.sources.get(source.uri.toString());
} else {
this.process.sources.set(source.uri.toString(), source);
}
return new StackFrame(this, rsf.id, source, rsf.name, rsf.line, rsf.column); return new StackFrame(this, rsf.id, source, rsf.name, rsf.line, rsf.column);
}); });
......
...@@ -28,10 +28,6 @@ export class Source { ...@@ -28,10 +28,6 @@ export class Source {
} }
public get inMemory() { public get inMemory() {
return Source.isInMemory(this.uri); return this.uri.toString().indexOf(`${DEBUG_SCHEME}:`) === 0;
}
public static isInMemory(uri: uri): boolean {
return uri.toString().indexOf(`${DEBUG_SCHEME}:`) === 0;
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册