提交 96413749 编写于 作者: A Andre Weinand

lookup sources only once

上级 2991abd9
......@@ -770,8 +770,10 @@ export class DebugSession implements IDebugSession {
getSource(raw: DebugProtocol.Source): Source {
let source = new Source(raw, this.getId());
const uriKey = this.getUriKey(source.uri);
if (this.sources.has(uriKey)) {
source = this.sources.get(uriKey);
const found = this.sources.get(uriKey);
if (found) {
source = found;
// merge attributes of new into existing
source.raw = mixin(source.raw, raw);
if (source.raw && raw) {
// Always take the latest presentation hint from adapter #42139
......@@ -785,6 +787,7 @@ export class DebugSession implements IDebugSession {
}
private getUriKey(uri: URI): string {
// TODO: the following code does not make sense if uri originates from a different platform
return platform.isLinux ? uri.toString() : uri.toString().toLowerCase();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册