diff --git a/src/extension.ts b/src/extension.ts index b3e64ad..bef2f39 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -112,4 +112,5 @@ export function activate(context: vscode.ExtensionContext) { // this method is called when your extension is deactivated export function deactivate() { + TelemetryClient.dispose(); } diff --git a/src/telemetryClient.ts b/src/telemetryClient.ts index 112798e..db7fde4 100644 --- a/src/telemetryClient.ts +++ b/src/telemetryClient.ts @@ -14,4 +14,11 @@ export class TelemetryClient { } private static _client = (packageJson.aiKey === 'undefined' || packageJson.aiKey === '') ? null : new TelemetryReporter(Constants.ExtensionId, packageJson.version, packageJson.aiKey); + + public static dispose(): Promise { + if (this._client) { + return this._client.dispose(); + } + return Promise.resolve(null); + } }