Skip to content

Commit 833fc7a

Browse files
committed
test fix
1 parent a06dbfc commit 833fc7a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/vs/workbench/api/node/extHostWorkspace.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,17 @@ export class ExtHostWorkspaceProvider {
326326
getRelativePath(pathOrUri: string | vscode.Uri, includeWorkspace?: boolean): string | undefined {
327327

328328
let resource: URI | undefined;
329+
let path: string | undefined;
329330
if (typeof pathOrUri === 'string') {
330331
resource = URI.file(pathOrUri);
332+
path = pathOrUri;
331333
} else if (typeof pathOrUri !== 'undefined') {
332334
resource = pathOrUri;
335+
path = pathOrUri.fsPath;
333336
}
334337

335338
if (!resource) {
336-
return undefined;
339+
return path;
337340
}
338341

339342
const folder = this.getWorkspaceFolder(
@@ -342,7 +345,7 @@ export class ExtHostWorkspaceProvider {
342345
);
343346

344347
if (!folder) {
345-
return resource.fsPath;
348+
return path;
346349
}
347350

348351
if (typeof includeWorkspace === 'undefined' && this._actualWorkspace) {

src/vs/workbench/common/resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class ResourceGlobMatcher extends Disposable {
195195
// but can match on "src/file.txt"
196196
let resourcePathToMatch: string;
197197
if (folder) {
198-
resourcePathToMatch = relativePath(folder.uri, resource); // always uses forward slashes
198+
resourcePathToMatch = relativePath(folder.uri, resource)!; // always uses forward slashes
199199
} else {
200200
resourcePathToMatch = resource.fsPath; // TODO@isidor: support non-file URIs
201201
}

0 commit comments

Comments
 (0)