提交 5717c6a5 编写于 作者: I isidor

debug: do not create unkown sources with no uri scheme

上级 2b6a9d40
......@@ -35,11 +35,16 @@ export class Source {
public available: boolean;
constructor(public raw: DebugProtocol.Source, sessionId: string) {
let path: string;
if (!raw) {
this.raw = { name: UNKNOWN_SOURCE_LABEL };
this.available = false;
path = `${DEBUG_SCHEME}:${UNKNOWN_SOURCE_LABEL}`;
} else {
path = this.raw.path || this.raw.name;
this.available = true;
}
this.available = this.raw.name !== UNKNOWN_SOURCE_LABEL;
const path = this.raw.path || this.raw.name;
if (this.raw.sourceReference > 0) {
this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}&ref=${this.raw.sourceReference}`);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册