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

Function onRequest

client/src/client.ts:2338–2348  ·  view source on GitHub ↗
(type: string | RPCMessageType, handler: GenericRequestHandler<R, E>)

Source from the content-addressed store, hash-verified

2336 public onRequest<P, R, E, RO>(type: RequestType<P, R, E, RO>, handler: RequestHandler<P, R, E>): void;
2337 public onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): void;
2338 public onRequest<R, E>(type: string | RPCMessageType, handler: GenericRequestHandler<R, E>): void {
2339 if (!this.isConnectionActive()) {
2340 throw new Error('Language client is not ready yet');
2341 }
2342 try {
2343 this._resolvedConnection!.onRequest(type, handler);
2344 } catch (error) {
2345 this.error(`Registering request handler ${Is.string(type) ? type : type.method} failed.`, error);
2346 throw error;
2347 }
2348 }
2349
2350 public sendNotification<RO>(type: NotificationType0<RO>): void;
2351 public sendNotification<P, RO>(type: NotificationType<P, RO>, params?: P): void;

Callers

nothing calls this directly

Calls 2

onRequestMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected