Adds setting to explicitly control telemetry

Disables zone.js monkey patching by application insights
This commit is contained in:
Eric Amodio
2017-06-07 12:15:50 -04:00
parent 4eb1c3e36a
commit 9cf86a41ec
4 changed files with 12 additions and 1 deletions

View File

@@ -98,6 +98,9 @@ export interface IAdvancedConfig {
quickPick: {
closeOnFocusOut: boolean;
};
telemetry: {
enabled: boolean;
};
toggleWhitespace: {
enabled: boolean;
};

View File

@@ -1,5 +1,6 @@
'use strict';
import { Disposable, env, version, workspace } from 'vscode';
import { ExtensionKey, IConfig } from './configuration';
import * as os from 'os';
let _reporter: TelemetryReporter;
@@ -7,7 +8,8 @@ let _reporter: TelemetryReporter;
export class Telemetry extends Disposable {
static configure(key: string) {
if (!workspace.getConfiguration('telemetry').get<boolean>('enableTelemetry', true)) return;
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
if (!cfg.advanced.telemetry.enabled || !workspace.getConfiguration('telemetry').get<boolean>('enableTelemetry', true)) return;
_reporter = new TelemetryReporter(key);
}