(type: string | RPCMessageType, handler: GenericNotificationHandler)
| 2368 | public onNotification<P, RO>(type: NotificationType<P, RO>, handler: NotificationHandler<P>): void; |
| 2369 | public onNotification(method: string, handler: GenericNotificationHandler): void; |
| 2370 | public onNotification(type: string | RPCMessageType, handler: GenericNotificationHandler): void { |
| 2371 | if (!this.isConnectionActive()) { |
| 2372 | throw new Error('Language client is not ready yet'); |
| 2373 | } |
| 2374 | try { |
| 2375 | this._resolvedConnection!.onNotification(type, handler); |
| 2376 | } catch (error) { |
| 2377 | this.error(`Registering notification handler ${Is.string(type) ? type : type.method} failed.`, error); |
| 2378 | throw error; |
| 2379 | } |
| 2380 | } |
| 2381 | |
| 2382 | public get clientOptions(): LanguageClientOptions { |
| 2383 | return this._clientOptions; |
nothing calls this directly
no test coverage detected