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

Function customRequest

src/debug/dart_debug_impl.ts:1337–1376  ·  view source on GitHub ↗
(request: string, response: DebugProtocol.Response, args: any)

Source from the content-addressed store, hash-verified

1335 }
1336
1337 protected async customRequest(request: string, response: DebugProtocol.Response, args: any): Promise<void> {
1338 try {
1339 switch (request) {
1340 case "callService":
1341 const result = await this.callService(args.method as string, args.params);
1342 response.body = result?.result;
1343 this.sendResponse(response);
1344 break;
1345 case "exposeUrlResponse":
1346 const completer = this.urlExposeCompleters[args.originalUrl];
1347 if (completer)
1348 completer.resolve({ url: args.exposedUrl });
1349 break;
1350 case "updateDebugOptions":
1351 this.debugExternalPackageLibraries = !!args.debugExternalPackageLibraries;
1352 this.debugSdkLibraries = !!args.debugSdkLibraries;
1353 await this.threadManager.setLibrariesDuggableForAllIsolates();
1354 this.sendResponse(response);
1355 break;
1356 case "hotReload":
1357 await this.reloadSources();
1358 this.sendResponse(response);
1359 break;
1360 // Flutter requests that may be sent during test runs or other places
1361 // that we don't currently support.
1362 case "hotRestart":
1363 // TODO: Get rid of this!
1364 this.log(`Ignoring Flutter customRequest ${request} for non-Flutter-run app`, LogSeverity.Warn);
1365 this.sendResponse(response);
1366 break;
1367 default:
1368 this.log(`Unknown customRequest ${request}`, LogSeverity.Warn);
1369 super.customRequest(request, response, args);
1370 break;
1371 }
1372 } catch (e: any) {
1373 this.logger.error(`Error handling '${request}' custom request: ${e}`);
1374 this.errorResponse(response, errorString(e));
1375 }
1376 }
1377
1378 // IsolateStart, IsolateRunnable, IsolateExit, IsolateUpdate, ServiceExtensionAdded
1379 public async handleIsolateEvent(event: VMEvent): Promise<void> {

Callers

nothing calls this directly

Calls 6

errorStringFunction · 0.90
sendResponseMethod · 0.80
errorMethod · 0.65
logMethod · 0.45
customRequestMethod · 0.45

Tested by

no test coverage detected