Skip to content

Commit

Permalink
use true casing rules when creating extensions tst, #134602
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Oct 11, 2021
1 parent b8ec998 commit 8db8a07
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/vs/workbench/api/common/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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` */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -272,17 +276,18 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
}

// create trie to enable fast 'filename -> extension id' look up
public getExtensionPathIndex(): Promise<TernarySearchTree<URI, IExtensionDescription>> {
public async getExtensionPathIndex(): Promise<TernarySearchTree<URI, IExtensionDescription>> {
if (!this._extensionPathIndex) {
const tst = TernarySearchTree.forUris<IExtensionDescription>();
const extensions = this._registry.getAllExtensionDescriptions().map(async ext => {
if (!this._getEntryPoint(ext)) {
return;
this._extensionPathIndex = (async () => {
const tst = TernarySearchTree.forUris<IExtensionDescription>(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;
}
Expand Down

0 comments on commit 8db8a07

Please sign in to comment.