Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function sendTelemetryEvent(eventName: string, properties?: {
[key: string]: string;
}, measures?: {
[key: string]: number;
}) {
// Check out later (no idea why default import isn't being picked up)
try {
reporter = reporter ? reporter : new TelemetryReporter(extensionId, extensionVersion, aiKey);
}
catch (ex) {
reporter = reporter ? reporter : new TelemetryReporter.default(extensionId, extensionVersion, aiKey);
}
try {
reporter.sendTelemetryEvent.apply(reporter, arguments);
}
catch (ex) {
}
}
return (id: string, version: string, telemetryKey: string) => new VsTelemetryReporter(id, version, telemetryKey);
} else {
function sendTelemetryEvent(eventName, properties, measures) {
telemtryReporter = telemtryReporter
? telemtryReporter
: new vscode_extension_telemetry_1.default(exports.extensionId, extensionVersion, aiKey);
telemtryReporter.sendTelemetryEvent(eventName, properties, measures);
}
//# sourceMappingURL=telemetry.js.map
constructor(
packageInfo: IPackageInfo
) {
this._reporter = new VSCodeTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
}
sendTelemetryEvent(eventName: string, properties?: {
function sendTelemetryEvent(eventName, properties, measures) {
reporter = reporter ? reporter : new vscode_extension_telemetry_1.default(extensionId, extensionVersion, aiKey);
reporter.sendTelemetryEvent.apply(reporter, arguments);
}
exports.sendTelemetryEvent = sendTelemetryEvent;
export function activate(context: vscode.ExtensionContext): Q.Promise {
outputChannelLogger.debug("Begin to activate...");
const appVersion = require(path.resolve(__dirname, "../../package.json")).version;
outputChannelLogger.debug(`Extension version: ${appVersion}`);
const ExtensionTelemetryReporter = require("vscode-extension-telemetry").default;
const reporter = new ExtensionTelemetryReporter(APP_NAME, appVersion, Telemetry.APPINSIGHTS_INSTRUMENTATIONKEY);
const configProvider = new ReactNativeDebugConfigProvider();
const workspaceFolders: vscode.WorkspaceFolder[] | undefined = vscode.workspace.workspaceFolders;
let extProps: ICommandTelemetryProperties = {};
if (workspaceFolders) {
extProps = {
["workspaceFoldersCount"]: {value: workspaceFolders.length, isPii: false},
};
}
return entryPointHandler.runApp(APP_NAME, appVersion, ErrorHelper.getInternalError(InternalErrorCode.ExtensionActivationFailed), reporter, function activateRunApp() {
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders((event) => onChangeWorkspaceFolders(context, event)));
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((event) => onChangeConfiguration(context)));
debugConfigProvider = vscode.debug.registerDebugConfigurationProvider("reactnative", configProvider);
let activateExtensionEvent = TelemetryHelper.createTelemetryEvent("activate");
Telemetry.send(activateExtensionEvent);