提交 11ab91e3 编写于 作者: J Johannes Rieken

rename (internal) _Uri to CachingUri

https://github.com/microsoft/vscode/issues/101978
上级 e683ace9
......@@ -252,7 +252,7 @@ export class URI implements UriComponents {
return this;
}
return new _URI(scheme, authority, path, query, fragment);
return new CachingURI(scheme, authority, path, query, fragment);
}
// ---- parse & validate ------------------------
......@@ -266,9 +266,9 @@ export class URI implements UriComponents {
static parse(value: string, _strict: boolean = false): URI {
const match = _regexp.exec(value);
if (!match) {
return new _URI(_empty, _empty, _empty, _empty, _empty);
return new CachingURI(_empty, _empty, _empty, _empty, _empty);
}
return new _URI(
return new CachingURI(
match[2] || _empty,
percentDecode(match[4] || _empty),
percentDecode(match[5] || _empty),
......@@ -323,11 +323,11 @@ export class URI implements UriComponents {
}
}
return new _URI('file', authority, path, _empty, _empty);
return new CachingURI('file', authority, path, _empty, _empty);
}
static from(components: { scheme: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {
return new _URI(
return new CachingURI(
components.scheme,
components.authority,
components.path,
......@@ -387,7 +387,7 @@ export class URI implements UriComponents {
} else if (data instanceof URI) {
return data;
} else {
const result = new _URI(data);
const result = new CachingURI(data);
result._formatted = (<UriState>data).external;
result._fsPath = (<UriState>data)._sep === _pathSepMarker ? (<UriState>data).fsPath : null;
return result;
......@@ -412,8 +412,8 @@ interface UriState extends UriComponents {
const _pathSepMarker = isWindows ? 1 : undefined;
// eslint-disable-next-line @typescript-eslint/naming-convention
class _URI extends URI {
// This class exists so that URI is compatibile with vscode.Uri (API).
class CachingURI extends URI {
_formatted: string | null = null;
_fsPath: string | null = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册