diff options
Diffstat (limited to 'src/vs/platform/workspace/common/workspace.ts')
-rw-r--r-- | src/vs/platform/workspace/common/workspace.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 82c3edb83ea..555c522c741 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -6,7 +6,6 @@ import { localize } from 'vs/nls'; import { Event } from 'vs/base/common/event'; import { extname } from 'vs/base/common/path'; -import { IWorkspaceFolderProvider } from 'vs/base/common/labels'; import { TernarySearchTree } from 'vs/base/common/map'; import { extname as resourceExtname, basenameOrAuthority, joinPath, extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; import { URI, UriComponents } from 'vs/base/common/uri'; @@ -16,7 +15,7 @@ import { Schemas } from 'vs/base/common/network'; export const IWorkspaceContextService = createDecorator<IWorkspaceContextService>('contextService'); -export interface IWorkspaceContextService extends IWorkspaceFolderProvider { +export interface IWorkspaceContextService { readonly _serviceBrand: undefined; @@ -295,7 +294,7 @@ export function isWorkspaceFolder(thing: unknown): thing is IWorkspaceFolder { export class Workspace implements IWorkspace { - private _foldersMap: TernarySearchTree<URI, WorkspaceFolder> = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing); + private _foldersMap: TernarySearchTree<URI, WorkspaceFolder> = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing, () => true); private _folders!: WorkspaceFolder[]; constructor( @@ -346,15 +345,11 @@ export class Workspace implements IWorkspace { return null; } - return this._foldersMap.findSubstr(resource.with({ - scheme: resource.scheme, - authority: resource.authority, - path: resource.path - })) || null; + return this._foldersMap.findSubstr(resource) || null; } private updateFoldersMap(): void { - this._foldersMap = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing); + this._foldersMap = TernarySearchTree.forUris<WorkspaceFolder>(this._ignorePathCasing, () => true); for (const folder of this.folders) { this._foldersMap.set(folder.uri, folder); } |