mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { SqlOpsDataClient } from 'dataprotocol-client';
|
|
import { ClientCapabilities, StaticFeature } from 'vscode-languageclient';
|
|
import { TelemetryReporter } from '../telemetry';
|
|
import * as contracts from './contracts';
|
|
import * as Utils from '../utils';
|
|
|
|
export class TelemetryFeature implements StaticFeature {
|
|
|
|
constructor(private _client: SqlOpsDataClient) { }
|
|
|
|
fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
Utils.ensure(capabilities, 'telemetry')!.telemetry = true;
|
|
}
|
|
|
|
initialize(): void {
|
|
this._client.onNotification(contracts.TelemetryNotification.type, e => {
|
|
TelemetryReporter.sendTelemetryEvent(e.params.eventName, e.params.properties, e.params.measures);
|
|
});
|
|
}
|
|
}
|