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

Method customRequest

src/debug/web_debug_impl.ts:208–238  ·  view source on GitHub ↗
(request: string, response: DebugProtocol.Response, args: any)

Source from the content-addressed store, hash-verified

206 }
207
208 protected async customRequest(request: string, response: DebugProtocol.Response, args: any): Promise<void> {
209 try {
210 switch (request) {
211 case "hotReload":
212 if (this.currentRunningAppId)
213 await this.performReload(false, args as { reason: string, debounce?: boolean });
214 this.sendResponse(response);
215 break;
216
217 case "hotRestart":
218 if (this.currentRunningAppId) {
219 this.reloadPackageMap();
220 await this.performReload(true, args as { reason: string, debounce?: boolean });
221 }
222 this.sendResponse(response);
223 break;
224
225 default:
226 await super.customRequest(request, response, args);
227 break;
228 }
229 } catch (e: any) {
230 const error = errorString(e);
231 const message = `Error handling '${request}' custom request: ${error}`;
232
233 if (!this.isTerminating)
234 this.sendEvent(new OutputEvent(`${message}\n`, "stderr"));
235 this.logger.error(message);
236 this.errorResponse(response, message);
237 }
238 }
239
240 protected async handleInspectEvent(event: VMEvent): Promise<void> {
241 if (!this.runDaemon || !this.currentRunningAppId)

Callers 1

customRequestFunction · 0.45

Calls 6

performReloadMethod · 0.95
reloadPackageMapMethod · 0.95
errorStringFunction · 0.90
sendResponseMethod · 0.80
sendEventMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected