disconnectRequest method
disconnectRequest is called by the client when it wants to forcefully shut
us down quickly. This comes after the terminateRequest
which is intended
to allow a graceful shutdown.
It's not very obvious from the names, but terminateRequest
is sent first
(a request for a graceful shutdown) and disconnectRequest
second (a
request for a forced shutdown).
https://microsoft.github.io/debug-adapter-protocol/overview#debug-session-end
Implementation
@override
Future<void> disconnectRequest(
Request request,
DisconnectArguments? args,
void Function() sendResponse,
) async {
isTerminating = true;
await disconnectImpl();
sendResponse();
await shutdown();
}