@@ -263,11 +263,31 @@ function onActivationEvent(): void {
263263 activatedPreviously . Value = true ;
264264}
265265
266+ function sendActivationTelemetry ( ) : void {
267+ const activateEvent : { [ key : string ] : string } = { } ;
268+ // Don't log telemetry for machineId if it's a special value used by the dev host: someValue.machineid
269+ if ( vscode . env . machineId !== "someValue.machineId" ) {
270+ const machineIdPersistentState : PersistentState < string | undefined > = new PersistentState < string | undefined > ( "CPP.machineId" , undefined ) ;
271+ if ( ! machineIdPersistentState . Value ) {
272+ activateEvent [ "newMachineId" ] = vscode . env . machineId ;
273+ } else if ( machineIdPersistentState . Value !== vscode . env . machineId ) {
274+ activateEvent [ "newMachineId" ] = vscode . env . machineId ;
275+ activateEvent [ "oldMachineId" ] = machineIdPersistentState . Value ;
276+ }
277+ machineIdPersistentState . Value = vscode . env . machineId ;
278+ }
279+ if ( vscode . env . remoteName ) {
280+ activateEvent [ "remoteName" ] = vscode . env . remoteName ;
281+ }
282+ telemetry . logLanguageServerEvent ( "Activate" , activateEvent ) ;
283+ }
284+
266285function realActivation ( ) : void {
267286 if ( new CppSettings ( ) . intelliSenseEngine === "Disabled" ) {
268287 throw new Error ( intelliSenseDisabledError ) ;
269288 } else {
270289 console . log ( "activating extension" ) ;
290+ sendActivationTelemetry ( ) ;
271291 const checkForConflictingExtensions : PersistentState < boolean > = new PersistentState < boolean > ( "CPP." + util . packageJson . version + ".checkForConflictingExtensions" , true ) ;
272292 if ( checkForConflictingExtensions . Value ) {
273293 checkForConflictingExtensions . Value = false ;
0 commit comments