MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / processServerRequest

Function processServerRequest

src/shared/services/stdio_service.ts:213–226  ·  view source on GitHub ↗
(request: Request<any>)

Source from the content-addressed store, hash-verified

211 protected isResponse(msg: any): boolean { return !!msg.id; }
212
213 private async processServerRequest(request: Request<any>) {
214 let result: unknown;
215 let error: unknown;
216 try {
217 result = await this.handleRequest(request.method, request.params);
218 } catch (e) {
219 error = e;
220 }
221 const resp = { id: request.id, result, error };
222 const json = this.messagesWrappedInBrackets
223 ? "[" + JSON.stringify(resp) + "]\r\n"
224 : JSON.stringify(resp) + "\r\n";
225 this.sendMessage(json);
226 }
227
228 private async handleResponse(evt: UnknownResponse): Promise<void> {
229 const handler = this.activeRequests[evt.id];

Callers

nothing calls this directly

Calls 2

sendMessageMethod · 0.80
handleRequestMethod · 0.45

Tested by

no test coverage detected