diff --git a/src/vs/workbench/api/common/extHostRequireInterceptor.ts b/src/vs/workbench/api/common/extHostRequireInterceptor.ts index b6609ed24a7..85ee4635675 100644 --- a/src/vs/workbench/api/common/extHostRequireInterceptor.ts +++ b/src/vs/workbench/api/common/extHostRequireInterceptor.ts @@ -59,7 +59,7 @@ export abstract class RequireInterceptor { const extensionPaths = await this._extHostExtensionService.getExtensionPathIndex(); this.register(new VSCodeNodeModuleFactory(this._apiFactory, extensionPaths, this._extensionRegistry, configProvider, this._logService)); - this.register(this._instaService.createInstance(KeytarNodeModuleFactory)); + this.register(this._instaService.createInstance(KeytarNodeModuleFactory, extensionPaths)); if (this._initData.remote.isRemote) { this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths, this._initData.environment.appUriScheme)); } @@ -140,14 +140,17 @@ interface IKeytarModule { class KeytarNodeModuleFactory implements INodeModuleFactory { public readonly nodeModuleName: string = 'keytar'; + private readonly _mainThreadTelemetry: MainThreadTelemetryShape; private alternativeNames: Set | undefined; private _impl: IKeytarModule; constructor( + private readonly _extensionPaths: TernarySearchTree, @IExtHostRpcService rpcService: IExtHostRpcService, @IExtHostInitDataService initData: IExtHostInitDataService, ) { + this._mainThreadTelemetry = rpcService.getProxy(MainContext.MainThreadTelemetry); const { environment } = initData; const mainThreadKeytar = rpcService.getProxy(MainContext.MainThreadKeytar); @@ -182,7 +185,12 @@ class KeytarNodeModuleFactory implements INodeModuleFactory { }; } - public load(_request: string, _parent: URI): any { + public load(_request: string, parent: URI): any { + const ext = this._extensionPaths.findSubstr(parent); + type ShimmingKeytarClassification = { + extension: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + this._mainThreadTelemetry.$publicLog2<{ extension: string }, ShimmingKeytarClassification>('shimming.keytar', { extension: ext?.identifier.value ?? 'unknown_extension' }); return this._impl; }