1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the MIT license.
3
3
4
- import * as fse from "fs-extra" ;
5
4
import * as vscode from "vscode" ;
6
5
import { addContextProperty , sendInfo } from "vscode-extension-telemetry-wrapper" ;
7
6
import { getExperimentationService , IExperimentationService , IExperimentationTelemetry , TargetPopulation } from "vscode-tas-client" ;
@@ -13,7 +12,12 @@ class ExperimentationTelemetry implements IExperimentationTelemetry {
13
12
}
14
13
15
14
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 ) ;
17
21
}
18
22
}
19
23
@@ -31,11 +35,4 @@ export function init(context: vscode.ExtensionContext): void {
31
35
// tslint:enable: no-string-literal
32
36
expService = getExperimentationService ( extensionName , extensionVersion ,
33
37
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 ) ;
41
38
}
0 commit comments