MCPcopy Create free account
hub / github.com/microsoft/debugpy / _request_start

Method _request_start

tests/debug/session.py:742–761  ·  view source on GitHub ↗
(self, method)

Source from the content-addressed store, hash-verified

740 return "".join(event("output", str) for event in events)
741
742 def _request_start(self, method):
743 self.config.normalize()
744 start_request = self.send_request(method, self.config)
745
746 # Depending on whether it's "noDebug" or not, we either get the "initialized"
747 # event, or an immediate response to our request.
748 self.timeline.wait_until_realized(
749 timeline.Event("initialized") | timeline.Response(start_request),
750 freeze=True,
751 )
752
753 if start_request.response is not None:
754 # It was an immediate response - either the request failed, or there is
755 # no configuration stage for this debug session.
756 start_request.response.result # raise exception if failed
757 return self.wait_for_process()
758
759 # We got "initialized" - now we need to yield to the caller, so that it can
760 # configure the session before it starts running.
761 return self._ConfigurationContextManager(self)
762
763 class _ConfigurationContextManager(object):
764 """Handles the start configuration sequence from "initialized" event until

Callers 2

request_launchMethod · 0.95
request_attachMethod · 0.95

Calls 4

send_requestMethod · 0.95
wait_for_processMethod · 0.95
normalizeMethod · 0.45
wait_until_realizedMethod · 0.45

Tested by

no test coverage detected