From 833fc7aa99734e2c1339d29c3e7074123ea42b95 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 15 Feb 2019 16:20:20 +0100 Subject: [PATCH] test fix --- src/vs/workbench/api/node/extHostWorkspace.ts | 7 +++++-- src/vs/workbench/common/resources.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/api/node/extHostWorkspace.ts b/src/vs/workbench/api/node/extHostWorkspace.ts index 9f85c4fa2aa..a0fec19ef9c 100644 --- a/src/vs/workbench/api/node/extHostWorkspace.ts +++ b/src/vs/workbench/api/node/extHostWorkspace.ts @@ -326,14 +326,17 @@ export class ExtHostWorkspaceProvider { getRelativePath(pathOrUri: string | vscode.Uri, includeWorkspace?: boolean): string | undefined { let resource: URI | undefined; + let path: string | undefined; if (typeof pathOrUri === 'string') { resource = URI.file(pathOrUri); + path = pathOrUri; } else if (typeof pathOrUri !== 'undefined') { resource = pathOrUri; + path = pathOrUri.fsPath; } if (!resource) { - return undefined; + return path; } const folder = this.getWorkspaceFolder( @@ -342,7 +345,7 @@ export class ExtHostWorkspaceProvider { ); if (!folder) { - return resource.fsPath; + return path; } if (typeof includeWorkspace === 'undefined' && this._actualWorkspace) { diff --git a/src/vs/workbench/common/resources.ts b/src/vs/workbench/common/resources.ts index 59da1881f15..b8cf29b7272 100644 --- a/src/vs/workbench/common/resources.ts +++ b/src/vs/workbench/common/resources.ts @@ -195,7 +195,7 @@ export class ResourceGlobMatcher extends Disposable { // but can match on "src/file.txt" let resourcePathToMatch: string; if (folder) { - resourcePathToMatch = relativePath(folder.uri, resource); // always uses forward slashes + resourcePathToMatch = relativePath(folder.uri, resource)!; // always uses forward slashes } else { resourcePathToMatch = resource.fsPath; // TODO@isidor: support non-file URIs }