Bundle SsmsMin directly into extension (#5450)

This commit is contained in:
Charles Gagnon
2019-05-09 18:28:49 -07:00
committed by GitHub
parent a501214bfa
commit 2b8e0cc6c4
7 changed files with 17 additions and 394 deletions

View File

@@ -6,7 +6,6 @@
'use strict';
import * as vscode from 'vscode';
import TelemetryReporter from 'vscode-extension-telemetry';
import { PlatformInformation } from 'service-downloader/out/platform';
import * as Utils from './utils';
@@ -37,23 +36,8 @@ export function filterErrorPath(line: string): string {
export class Telemetry {
private static reporter: TelemetryReporter;
private static userId: string;
private static platformInformation: PlatformInformation;
private static disabled: boolean;
public static getPlatformInformation(): Promise<PlatformInformation> {
if (this.platformInformation) {
return Promise.resolve(this.platformInformation);
} else {
return new Promise<PlatformInformation>(resolve => {
PlatformInformation.getCurrent().then(info => {
this.platformInformation = info;
resolve(this.platformInformation);
});
});
}
}
/**
* Disable telemetry reporting
*/
@@ -122,13 +106,7 @@ export class Telemetry {
properties = {};
}
// Augment the properties structure with additional common properties before sending
Promise.all([this.getPlatformInformation()]).then(() => {
properties['distribution'] = (this.platformInformation && this.platformInformation.distribution) ?
`${this.platformInformation.distribution.name}, ${this.platformInformation.distribution.version}` : '';
this.reporter.sendTelemetryEvent(eventName, properties, measures);
});
this.reporter.sendTelemetryEvent(eventName, properties, measures);
}
}