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

This commit is contained in:
David Sanders
2020-11-24 18:04:03 +01:00
committed by GitHub
parent c37ffd83ba
commit 5987e40765
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1905,7 +1905,7 @@ declare module 'vscode' {
* @param pattern A file glob pattern like `*.{ts,js}` that will be matched on file paths
* relative to the base path.
*/
constructor(base: WorkspaceFolder | string, pattern: string)
constructor(base: Uri | WorkspaceFolder | string, pattern: string)
}
/**
+5 -2
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;