Skip to content

Commit 6129922

Browse files
authored
Merge pull request microsoft#204374 from microsoft/sandy081/fix-telemetry
sent string value in telemetry
2 parents 4896862 + 6b18398 commit 6129922

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@ class ConfigurationTelemetryContribution extends Disposable implements IWorkbenc
281281
/**
282282
* Report value of a setting only if it is an enum, boolean, or number or an array of those.
283283
*/
284-
private getValueToReport(key: string, target: ConfigurationTarget.USER_LOCAL | ConfigurationTarget.WORKSPACE): any {
284+
private getValueToReport(key: string, target: ConfigurationTarget.USER_LOCAL | ConfigurationTarget.WORKSPACE): string | undefined {
285285
const schema = this.configurationRegistry.getConfigurationProperties()[key];
286286
const inpsectData = this.configurationService.inspect(key);
287287
const value = target === ConfigurationTarget.USER_LOCAL ? inpsectData.user?.value : inpsectData.workspace?.value;
288288
if (isNumber(value) || isBoolean(value)) {
289-
return value;
289+
return value.toString();
290290
}
291291
if (isString(value)) {
292292
if (schema?.enum?.includes(value)) {
@@ -296,15 +296,15 @@ class ConfigurationTelemetryContribution extends Disposable implements IWorkbenc
296296
}
297297
if (Array.isArray(value)) {
298298
if (value.every(v => isNumber(v) || isBoolean(v) || (isString(v) && schema?.enum?.includes(v)))) {
299-
return value;
299+
return JSON.stringify(value);
300300
}
301301
}
302302
return undefined;
303303
}
304304

305305
private reportTelemetry(key: string, target: ConfigurationTarget.USER_LOCAL | ConfigurationTarget.WORKSPACE): void {
306306
type UpdatedSettingEvent = {
307-
value: any;
307+
value: string | undefined;
308308
source: string;
309309
};
310310
const source = ConfigurationTargetToString(target);

0 commit comments

Comments
 (0)