launchRequest method

  1. @override
Future<void> launchRequest(
  1. Request request,
  2. TL args,
  3. void sendResponse()
)

launchRequest is called by the client when it wants us to start the app to be run/debug. This will only be called once (and only one of this or attachRequest will be called).

Implementation

@override
Future<void> launchRequest(
  Request request,
  TL args,
  void Function() sendResponse,
) async {
  try {
    this.args = args as DartCommonLaunchAttachRequestArguments;
    isAttach = false;

    // Common setup.
    await _prepareForLaunchOrAttach(args.noDebug);

    // Delegate to the sub-class to launch the process.
    await launchAndRespond(sendResponse);
  } on DebugAdapterException catch (e) {
    // Any errors that are thrown as part of an AttachRequest should be shown
    // to the user.
    throw DebugAdapterException(e.message, showToUser: true);
  }
}