MCPcopy
hub / github.com/microsoft/vscode-languageserver-node / sendRequest

Function sendRequest

client/src/client.ts:2322–2333  ·  view source on GitHub ↗
(type: string | RPCMessageType, ...params: any[])

Source from the content-addressed store, hash-verified

2320 public sendRequest<R>(method: string, token?: CancellationToken): Thenable<R>;
2321 public sendRequest<R>(method: string, param: any, token?: CancellationToken): Thenable<R>;
2322 public sendRequest<R>(type: string | RPCMessageType, ...params: any[]): Thenable<R> {
2323 if (!this.isConnectionActive()) {
2324 throw new Error('Language client is not ready yet');
2325 }
2326 this.forceDocumentSync();
2327 try {
2328 return this._resolvedConnection!.sendRequest<R>(type, ...params);
2329 } catch (error) {
2330 this.error(`Sending request ${Is.string(type) ? type : type.method} failed.`, error);
2331 throw error;
2332 }
2333 }
2334
2335 public onRequest<R, E, RO>(type: RequestType0<R, E, RO>, handler: RequestHandler0<R, E>): void;
2336 public onRequest<P, R, E, RO>(type: RequestType<P, R, E, RO>, handler: RequestHandler<P, R, E>): void;

Callers

nothing calls this directly

Calls 2

sendRequestMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected