11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
4- import * as fse from "fs-extra" ;
54import * as vscode from "vscode" ;
65import { addContextProperty , sendInfo } from "vscode-extension-telemetry-wrapper" ;
76import { getExperimentationService , IExperimentationService , IExperimentationTelemetry , TargetPopulation } from "vscode-tas-client" ;
@@ -13,7 +12,12 @@ class ExperimentationTelemetry implements IExperimentationTelemetry {
1312 }
1413
1514 public postEvent ( eventName : string , props : Map < string , string > ) : void {
16- // do nothing
15+ const payload : any = { __event_name__ : eventName } ;
16+ for ( const [ key , value ] of props ) {
17+ payload [ key ] = value ;
18+ }
19+
20+ sendInfo ( "" , payload ) ;
1721 }
1822}
1923
@@ -31,11 +35,4 @@ export function init(context: vscode.ExtensionContext): void {
3135 // tslint:enable: no-string-literal
3236 expService = getExperimentationService ( extensionName , extensionVersion ,
3337 TargetPopulation . Public , new ExperimentationTelemetry ( ) , context . globalState ) ;
34-
35- // Due to a bug in the tas-client module, a call to isFlightEnabledAsync is required to begin
36- // polling the TAS. Due to a separate bug, this call must be preceeded by a call to isCachedFlightEnabled.
37- const asyncDummyCheck = ( arg : any ) => {
38- expService ?. isFlightEnabledAsync ( "dummy" ) . then ( ( v ) => { return ; } ) . catch ( ( r ) => { return ; } ) ;
39- } ;
40- expService ?. isCachedFlightEnabled ( "dummy" ) . then ( asyncDummyCheck ) . catch ( asyncDummyCheck ) ;
4138}
0 commit comments