| 867 | } |
| 868 | |
| 869 | class TracerImpl implements Tracer { |
| 870 | |
| 871 | private _trace: Trace; |
| 872 | private _connection: IConnection; |
| 873 | |
| 874 | constructor() { |
| 875 | this._trace = Trace.Off; |
| 876 | } |
| 877 | |
| 878 | public attach(connection: IConnection) { |
| 879 | this._connection = connection; |
| 880 | } |
| 881 | |
| 882 | public get connection(): IConnection { |
| 883 | if (!this._connection) { |
| 884 | throw new Error('Remote is not attached to a connection yet.'); |
| 885 | } |
| 886 | return this._connection; |
| 887 | } |
| 888 | |
| 889 | public initialize(_capabilities: ClientCapabilities): void { |
| 890 | } |
| 891 | |
| 892 | public fillServerCapabilities(_capabilities: ServerCapabilities): void { |
| 893 | } |
| 894 | |
| 895 | public set trace(value: Trace) { |
| 896 | this._trace = value; |
| 897 | } |
| 898 | |
| 899 | public log(message: string, verbose?: string): void { |
| 900 | if (this._trace === Trace.Off) { |
| 901 | return; |
| 902 | } |
| 903 | this._connection.sendNotification(LogTraceNotification.type, { |
| 904 | message: message, |
| 905 | verbose: this._trace === Trace.Verbose ? verbose : undefined |
| 906 | }); |
| 907 | } |
| 908 | } |
| 909 | |
| 910 | class TelemetryImpl implements Telemetry { |
| 911 |
nothing calls this directly
no outgoing calls
no test coverage detected