MCPcopy Index your code
hub / github.com/microsoft/vscode-languageserver-node / onNotification

Function onNotification

client/src/client.ts:2370–2380  ·  view source on GitHub ↗
(type: string | RPCMessageType, handler: GenericNotificationHandler)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

onNotificationMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected