Add vscode.Uri to types for vscode.RelativePattern's base parameter (#111155)

This commit is contained in:
David Sanders
2020-11-24 09:04:03 -08:00
committed by GitHub
parent c37ffd83ba
commit 5987e40765
2 changed files with 6 additions and 3 deletions

View File

@@ -2193,9 +2193,9 @@ export class RelativePattern implements IRelativePattern {
pattern: string;
constructor(base: vscode.WorkspaceFolder | string, pattern: string) {
constructor(base: URI | vscode.WorkspaceFolder | string, pattern: string) {
if (typeof base !== 'string') {
if (!base || !URI.isUri(base.uri)) {
if (!base || !URI.isUri(base) && !URI.isUri(base.uri)) {
throw illegalArgument('base');
}
}
@@ -2206,6 +2206,9 @@ export class RelativePattern implements IRelativePattern {
if (typeof base === 'string') {
this.base = base;
} else if (URI.isUri(base)) {
this.baseFolder = base;
this.base = base.fsPath;
} else {
this.baseFolder = base.uri;
this.base = base.uri.fsPath;