diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 7b66a268eedf68f50a76cbc7f0f0a46cc8e40b5a..f1af73f02ad5d03bae9360ec7df8c3c1b8f80ae0 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -34,7 +34,7 @@ export interface IWorkspaceContextService { * without leading or trailing slashes. Returns null if the file is not inside an opened * workspace. */ - toWorkspaceRelativePath: (resource: URI) => string; + toWorkspaceRelativePath: (resource: URI, toOSPath?: boolean) => string; /** * Given a workspace relative path, returns the resource with the absolute path. @@ -89,9 +89,9 @@ export class WorkspaceContextService implements IWorkspaceContextService { return false; } - public toWorkspaceRelativePath(resource: URI): string { + public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { if (this.isInsideWorkspace(resource)) { - return paths.normalize(paths.relative(this.workspace.resource.fsPath, resource.fsPath)); + return paths.normalize(paths.relative(this.workspace.resource.fsPath, resource.fsPath), toOSPath); } return null; diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index 305779e9dec6e61633d5dbf0f2b0ac3846ac1145..a4aa43bf9fb946118c9de14d4da010dce7d593df 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -602,7 +602,7 @@ export class FileFilter implements IFilter { // Hide those that match Hidden Patterns const siblingsFn = () => siblings && siblings.map(c => c.name); - if (glob.match(this.hiddenExpression, this.contextService.toWorkspaceRelativePath(stat.resource), siblingsFn)) { + if (glob.match(this.hiddenExpression, this.contextService.toWorkspaceRelativePath(stat.resource, true), siblingsFn)) { return false; // hidden through pattern } diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index bda563c616eda4ecdd2e4e982d3e2688ae32ff8e..6fcfa139324a1cbae24dd1b117c116e4eeaceb8a 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -96,8 +96,8 @@ export class TestContextService implements IWorkspaceContextService { return false; } - public toWorkspaceRelativePath(resource: URI): string { - return paths.makePosixAbsolute(paths.normalize(resource.fsPath.substr('c:'.length))); + public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { + return paths.makePosixAbsolute(paths.normalize(resource.fsPath.substr('c:'.length), toOSPath)); } public toResource(workspaceRelativePath: string): URI {