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

Function launch

tests/debug/runners.py:118–148  ·  view source on GitHub ↗
(session, target, console=None, cwd=None)

Source from the content-addressed store, hash-verified

116
117@_runner
118def launch(session, target, console=None, cwd=None):
119 assert console in (
120 None,
121 "internalConsole",
122 "integratedTerminal",
123 "externalTerminal",
124 )
125
126 log.info("Launching {0} in {1} using {2}.", target, session, json.repr(console))
127
128 target.configure(session)
129 config = session.config
130 config.setdefaults(
131 {"console": "externalTerminal", "internalConsoleOptions": "neverOpen"}
132 )
133 if console is not None:
134 config["console"] = console
135 if cwd is not None:
136 config["cwd"] = cwd
137 if "python" not in config and "pythonPath" not in config:
138 config["python"] = sys.executable
139
140 env = (
141 session.spawn_adapter.env
142 if config["console"] == "internalConsole"
143 else config.env
144 )
145 target.cli(env)
146
147 session.spawn_adapter()
148 return session.request_launch()
149
150
151def _attach_common_config(session, target, cwd):

Callers

nothing calls this directly

Calls 6

infoMethod · 0.80
setdefaultsMethod · 0.80
spawn_adapterMethod · 0.80
request_launchMethod · 0.80
configureMethod · 0.45
cliMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…