| 908 | } |
| 909 | |
| 910 | class TelemetryImpl implements Telemetry { |
| 911 | |
| 912 | private _connection: IConnection; |
| 913 | |
| 914 | constructor() { |
| 915 | } |
| 916 | |
| 917 | public attach(connection: IConnection) { |
| 918 | this._connection = connection; |
| 919 | } |
| 920 | |
| 921 | public get connection(): IConnection { |
| 922 | if (!this._connection) { |
| 923 | throw new Error('Remote is not attached to a connection yet.'); |
| 924 | } |
| 925 | return this._connection; |
| 926 | } |
| 927 | |
| 928 | public initialize(_capabilities: ClientCapabilities): void { |
| 929 | } |
| 930 | |
| 931 | public fillServerCapabilities(_capabilities: ServerCapabilities): void { |
| 932 | } |
| 933 | |
| 934 | public logEvent(data: any): void { |
| 935 | this._connection.sendNotification(TelemetryEventNotification.type, data); |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | /** |
| 940 | * Interface to describe the shape of the server connection. |
nothing calls this directly
no outgoing calls
no test coverage detected