MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _generate_launch

Method _generate_launch

tools/ng/generator.py:192–215  ·  view source on GitHub ↗

Generate launch.json.

(self, vscode_dir: str, context)

Source from the content-addressed store, hash-verified

190 json.dump(tasks, f, indent=4)
191
192 def _generate_launch(self, vscode_dir: str, context) -> None:
193 """Generate launch.json."""
194 launch = {
195 "version": "0.2.0",
196 "configurations": [
197 {
198 "name": "Cortex Debug",
199 "type": "cortex-debug",
200 "request": "launch",
201 "servertype": "openocd",
202 "cwd": "${workspaceRoot}",
203 "executable": "${workspaceRoot}/" + self.config.target_name,
204 "device": "STM32F103C8",
205 "configFiles": [
206 "interface/stlink-v2.cfg",
207 "target/stm32f1x.cfg"
208 ]
209 }
210 ]
211 }
212
213 output_path = os.path.join(vscode_dir, 'launch.json')
214 with open(output_path, 'w') as f:
215 json.dump(launch, f, indent=4)
216
217 def _generate_settings(self, vscode_dir: str) -> None:
218 """Generate settings.json."""

Callers 1

generateMethod · 0.95

Calls 3

openFunction · 0.50
joinMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected