From c15218d09e7111ec754ded8e6fb897766ae004c8 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 11 Oct 2021 17:13:03 +0200 Subject: [PATCH] use biased extUri when feeding data into extensions tst, https://github.com/microsoft/vscode/issues/134602 --- .../api/common/extHostExtensionService.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index 085091a0b95..5f66839baed 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import * as path from 'vs/base/common/path'; import * as performance from 'vs/base/common/performance'; -import { originalFSPath, joinPath } from 'vs/base/common/resources'; +import { originalFSPath, joinPath, extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; import { asPromise, Barrier, timeout } from 'vs/base/common/async'; import { dispose, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle'; import { TernarySearchTree } from 'vs/base/common/map'; @@ -38,7 +38,6 @@ 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` */ @@ -88,7 +87,6 @@ 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; @@ -124,7 +122,6 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme @IExtensionStoragePaths storagePath: IExtensionStoragePaths, @IExtHostTunnelService extHostTunnelService: IExtHostTunnelService, @IExtHostTerminalService extHostTerminalService: IExtHostTerminalService, - @IExtHostFileSystemInfo extHostFileSystemInfo: IExtHostFileSystemInfo ) { super(); this._hostUtils = hostUtils; @@ -136,7 +133,6 @@ 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); @@ -279,7 +275,13 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme public async getExtensionPathIndex(): Promise> { if (!this._extensionPathIndex) { this._extensionPathIndex = (async () => { - const tst = TernarySearchTree.forUris(key => this._extHostFileSystemInfo.extUri.ignorePathCasing(key)); + const tst = TernarySearchTree.forUris(key => { + // using the default/biased extUri-util because the IExtHostFileSystemInfo-service + // isn't ready to be used yet, e.g the knowledge about `file` protocol and others + // comes in while this code runs + return extUriBiasedIgnorePathCase.ignorePathCasing(key); + }); + // const tst = TernarySearchTree.forUris(key => true); for (const ext of this._registry.getAllExtensionDescriptions()) { if (this._getEntryPoint(ext)) { const uri = await this._realPathExtensionUri(ext.extensionLocation);