From 8db8a07b4e157783caf7afc60334d2c17a2dba9f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 11 Oct 2021 15:24:20 +0200 Subject: [PATCH] use true casing rules when creating extensions tst, #134602 --- .../api/common/extHostExtensionService.ts | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index ad89e7f0f3d..085091a0b95 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -38,6 +38,7 @@ import { IExtensionActivationHost, checkActivateWorkspaceContainsExtension } fro import { ExtHostSecretState, IExtHostSecretState } from 'vs/workbench/api/common/exHostSecretState'; import { ExtensionSecrets } from 'vs/workbench/api/common/extHostSecrets'; import { Schemas } from 'vs/base/common/network'; +import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; interface ITestRunner { /** Old test runner API, as exported from `vscode/lib/testrunner` */ @@ -87,6 +88,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme protected readonly _logService: ILogService; protected readonly _extHostTunnelService: IExtHostTunnelService; protected readonly _extHostTerminalService: IExtHostTerminalService; + protected readonly _extHostFileSystemInfo: IExtHostFileSystemInfo; protected readonly _mainThreadWorkspaceProxy: MainThreadWorkspaceShape; protected readonly _mainThreadTelemetryProxy: MainThreadTelemetryShape; @@ -122,6 +124,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme @IExtensionStoragePaths storagePath: IExtensionStoragePaths, @IExtHostTunnelService extHostTunnelService: IExtHostTunnelService, @IExtHostTerminalService extHostTerminalService: IExtHostTerminalService, + @IExtHostFileSystemInfo extHostFileSystemInfo: IExtHostFileSystemInfo ) { super(); this._hostUtils = hostUtils; @@ -133,6 +136,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme this._logService = logService; this._extHostTunnelService = extHostTunnelService; this._extHostTerminalService = extHostTerminalService; + this._extHostFileSystemInfo = extHostFileSystemInfo; this._disposables = new DisposableStore(); this._mainThreadWorkspaceProxy = this._extHostContext.getProxy(MainContext.MainThreadWorkspace); @@ -272,17 +276,18 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme } // create trie to enable fast 'filename -> extension id' look up - public getExtensionPathIndex(): Promise> { + public async getExtensionPathIndex(): Promise> { if (!this._extensionPathIndex) { - const tst = TernarySearchTree.forUris(); - const extensions = this._registry.getAllExtensionDescriptions().map(async ext => { - if (!this._getEntryPoint(ext)) { - return; + this._extensionPathIndex = (async () => { + const tst = TernarySearchTree.forUris(key => this._extHostFileSystemInfo.extUri.ignorePathCasing(key)); + for (const ext of this._registry.getAllExtensionDescriptions()) { + if (this._getEntryPoint(ext)) { + const uri = await this._realPathExtensionUri(ext.extensionLocation); + tst.set(uri, ext); + } } - const uri = await this._realPathExtensionUri(ext.extensionLocation); - tst.set(uri, ext); - }); - this._extensionPathIndex = Promise.all(extensions).then(() => tst); + return tst; + })(); } return this._extensionPathIndex; }