@@ -17,7 +17,7 @@ let _installLog: NodeJS.WritableStream;
1717let _reporter : TelemetryReporter ; // Telemetry reporter
1818const _completionFileName : string = 'install.complete' ;
1919
20- export function installCoreClrDebug ( context : vscode . ExtensionContext ) {
20+ export function installCoreClrDebug ( context : vscode . ExtensionContext , reporter : TelemetryReporter ) {
2121 _coreClrDebugDir = path . join ( context . extensionPath , 'coreclr-debug' ) ;
2222 _debugAdapterDir = path . join ( _coreClrDebugDir , 'debugAdapters' ) ;
2323
@@ -39,7 +39,7 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
3939 return ;
4040 }
4141
42- initializeTelemetry ( context ) ;
42+ _reporter = reporter ;
4343 _channel = vscode . window . createOutputChannel ( 'coreclr-debug' ) ;
4444
4545 // Create our log file and override _channel.append to also outpu to the log
@@ -95,17 +95,6 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
9595 } ) ;
9696}
9797
98- function initializeTelemetry ( context : vscode . ExtensionContext ) {
99- // parse our own package.json into json
100- const packageJson = JSON . parse ( fs . readFileSync ( path . join ( context . extensionPath , 'package.json' ) ) . toString ( ) ) ;
101-
102- let extensionId = packageJson [ "publisher" ] + "." + packageJson [ "name" ] ;
103- let extensionVersion = packageJson [ "version" ] ;
104- let aiKey = packageJson . contributes . debuggers [ 0 ] [ "aiKey" ] ;
105-
106- _reporter = new TelemetryReporter ( extensionId , extensionVersion , aiKey ) ;
107- }
108-
10998function logTelemetry ( eventName : string , properties ?: { [ prop : string ] : string } ) {
11099 if ( _reporter )
111100 {
0 commit comments