diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 117744ceb92..ada25847aad 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -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) } /** diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 8788574ca1b..5e103f86870 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -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;