diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 09430ded67d..60df0a74ecb 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -6,8 +6,6 @@ import { URI } from 'vs/base/common/uri'; import { CharCode } from 'vs/base/common/charCode'; import { compareSubstringIgnoreCase, compare, compareSubstring, compareIgnoreCase } from 'vs/base/common/strings'; -import { isLinux } from 'vs/base/common/platform'; -import { Schemas } from 'vs/base/common/network'; export function getOrSet(map: Map, key: K, value: V): V { let result = map.get(key); @@ -228,14 +226,7 @@ class TernarySearchTreeNode { export class TernarySearchTree { - /** - * @deprecated - */ - static forUris(ignorePathCasing?: boolean): TernarySearchTree { - return new TernarySearchTree(new UriIterator(key => ignorePathCasing ?? (key.scheme === Schemas.file && isLinux))); - } - - static forUris2(ignorePathCasing: (key: URI) => boolean = () => false): TernarySearchTree { + static forUris(ignorePathCasing: (key: URI) => boolean = () => false): TernarySearchTree { return new TernarySearchTree(new UriIterator(ignorePathCasing)); } diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts index 8648504a3c5..23001b2a20f 100644 --- a/src/vs/platform/files/common/fileService.ts +++ b/src/vs/platform/files/common/fileService.ts @@ -194,7 +194,7 @@ export class FileService extends Disposable implements IFileService { // lazy trie to check for recursive resolving if (!trie) { - trie = TernarySearchTree.forUris2(() => !isPathCaseSensitive); + trie = TernarySearchTree.forUris(() => !isPathCaseSensitive); trie.set(resource, true); if (isNonEmptyArray(resolveTo)) { resolveTo.forEach(uri => trie!.set(uri, true)); diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 4232528124a..4ae15434563 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -521,19 +521,19 @@ export class FileChangesEvent { switch (change.type) { case FileChangeType.ADDED: if (!this.added) { - this.added = TernarySearchTree.forUris2(() => this.ignorePathCasing); + this.added = TernarySearchTree.forUris(() => this.ignorePathCasing); } this.added.set(change.resource, change); break; case FileChangeType.UPDATED: if (!this.updated) { - this.updated = TernarySearchTree.forUris2(() => this.ignorePathCasing); + this.updated = TernarySearchTree.forUris(() => this.ignorePathCasing); } this.updated.set(change.resource, change); break; case FileChangeType.DELETED: if (!this.deleted) { - this.deleted = TernarySearchTree.forUris2(() => this.ignorePathCasing); + this.deleted = TernarySearchTree.forUris(() => this.ignorePathCasing); } this.deleted.set(change.resource, change); break; diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index d29475f34ec..72ca615f926 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -144,7 +144,7 @@ export interface IWorkspaceFolder extends IWorkspaceFolderData { export class Workspace implements IWorkspace { - private _foldersMap: TernarySearchTree = TernarySearchTree.forUris2(this._ignorePathCasing); + private _foldersMap: TernarySearchTree = TernarySearchTree.forUris(this._ignorePathCasing); private _folders!: WorkspaceFolder[]; constructor( @@ -197,7 +197,7 @@ export class Workspace implements IWorkspace { } private updateFoldersMap(): void { - this._foldersMap = TernarySearchTree.forUris2(this._ignorePathCasing); + this._foldersMap = TernarySearchTree.forUris(this._ignorePathCasing); for (const folder of this.folders) { this._foldersMap.set(folder.uri, folder); } diff --git a/src/vs/workbench/api/common/extHostWorkspace.ts b/src/vs/workbench/api/common/extHostWorkspace.ts index bebdc6eef2a..1434932e36e 100644 --- a/src/vs/workbench/api/common/extHostWorkspace.ts +++ b/src/vs/workbench/api/common/extHostWorkspace.ts @@ -127,7 +127,7 @@ class ExtHostWorkspaceImpl extends Workspace { constructor(id: string, private _name: string, folders: vscode.WorkspaceFolder[], configuration: URI | null, private _isUntitled: boolean, ignorePathCasing: (key: URI) => boolean) { super(id, folders.map(f => new WorkspaceFolder(f)), configuration, ignorePathCasing); - this._structure = TernarySearchTree.forUris2(ignorePathCasing); + this._structure = TernarySearchTree.forUris(ignorePathCasing); // setup the workspace folder data structure folders.forEach(folder => { diff --git a/src/vs/workbench/contrib/markers/browser/markersFilterOptions.ts b/src/vs/workbench/contrib/markers/browser/markersFilterOptions.ts index 66e0c576442..b1709385346 100644 --- a/src/vs/workbench/contrib/markers/browser/markersFilterOptions.ts +++ b/src/vs/workbench/contrib/markers/browser/markersFilterOptions.ts @@ -22,7 +22,7 @@ export class ResourceGlobMatcher { uriIdentityService: IUriIdentityService ) { this.globalExpression = parse(globalExpression); - this.expressionsByRoot = TernarySearchTree.forUris2<{ root: URI, expression: ParsedExpression }>(uriIdentityService.extUri.ignorePathCasing); + this.expressionsByRoot = TernarySearchTree.forUris<{ root: URI, expression: ParsedExpression }>(uriIdentityService.extUri.ignorePathCasing); for (const expression of rootExpressions) { this.expressionsByRoot.set(expression.root, { root: expression.root, expression: parse(expression.expression) }); } diff --git a/src/vs/workbench/contrib/search/common/searchModel.ts b/src/vs/workbench/contrib/search/common/searchModel.ts index 832f7bcf88d..465e4f6af7b 100644 --- a/src/vs/workbench/contrib/search/common/searchModel.ts +++ b/src/vs/workbench/contrib/search/common/searchModel.ts @@ -711,7 +711,7 @@ export class SearchResult extends Disposable { private _folderMatches: FolderMatchWithResource[] = []; private _otherFilesMatch: FolderMatch | null = null; - private _folderMatchesMap: TernarySearchTree = TernarySearchTree.forUris2(key => this.uriIdentityService.extUri.ignorePathCasing(key)); + private _folderMatchesMap: TernarySearchTree = TernarySearchTree.forUris(key => this.uriIdentityService.extUri.ignorePathCasing(key)); private _showHighlights: boolean = false; private _query: ITextQuery | null = null; @@ -757,7 +757,7 @@ export class SearchResult extends Disposable { .then(() => this._isDirty = false); this._rangeHighlightDecorations.removeHighlightRange(); - this._folderMatchesMap = TernarySearchTree.forUris2(key => this.uriIdentityService.extUri.ignorePathCasing(key)); + this._folderMatchesMap = TernarySearchTree.forUris(key => this.uriIdentityService.extUri.ignorePathCasing(key)); if (!query) { return; @@ -979,7 +979,7 @@ export class SearchResult extends Disposable { private disposeMatches(): void { this.folderMatches().forEach(folderMatch => folderMatch.dispose()); this._folderMatches = []; - this._folderMatchesMap = TernarySearchTree.forUris2(key => this.uriIdentityService.extUri.ignorePathCasing(key)); + this._folderMatchesMap = TernarySearchTree.forUris(key => this.uriIdentityService.extUri.ignorePathCasing(key)); this._rangeHighlightDecorations.removeHighlightRange(); } diff --git a/src/vs/workbench/services/decorations/browser/decorationsService.ts b/src/vs/workbench/services/decorations/browser/decorationsService.ts index 842849af346..5205f3f7688 100644 --- a/src/vs/workbench/services/decorations/browser/decorationsService.ts +++ b/src/vs/workbench/services/decorations/browser/decorationsService.ts @@ -169,7 +169,7 @@ class DecorationStyles { class FileDecorationChangeEvent implements IResourceDecorationChangeEvent { - private readonly _data = TernarySearchTree.forUris2(_uri => true); // events ignore all path casings + private readonly _data = TernarySearchTree.forUris(_uri => true); // events ignore all path casings affectsResource(uri: URI): boolean { return this._data.get(uri) ?? this._data.findSuperstr(uri) !== undefined; @@ -212,7 +212,7 @@ class DecorationProviderWrapper { private readonly _flushEmitter: Emitter ) { - this.data = TernarySearchTree.forUris2(uri => uriIdentityService.extUri.ignorePathCasing(uri)); + this.data = TernarySearchTree.forUris(uri => uriIdentityService.extUri.ignorePathCasing(uri)); this._dispoable = this.provider.onDidChange(uris => { if (!uris) { diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts index b8171e2f3b4..342ec2dc402 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts @@ -30,7 +30,7 @@ export class ExtensionHostProfiler { } private distill(profile: Profile, extensions: IExtensionDescription[]): IExtensionHostProfile { - let searchTree = TernarySearchTree.forUris2(); + let searchTree = TernarySearchTree.forUris(); for (let extension of extensions) { if (extension.extensionLocation.scheme === Schemas.file) { searchTree.set(URI.file(realpathSync(extension.extensionLocation.fsPath)), extension);