launch.json holds VS Code’s debug configurations: how to start a program
under the debugger, or attach to one that is running. Comments and trailing commas are
allowed.
Structure
| Member | Value |
|---|---|
version | The format’s version, "0.2.0". |
configurations | An array of configurations. |
compounds | An optional array of named groups of configurations, started together. |
Every configuration needs these three attributes; the others depend on its debugger:
| Attribute | Value |
|---|---|
name | What it is called in the debug menu. |
type | Which debugger, such as node or python. |
request | launch or attach. |
Optional attributes include preLaunchTask, postDebugTask
and presentation. A compound has a name and a
configurations array of names.
{
"version": "0.2.0",
"configurations": [
{ "name": "Run", "type": "node", "request": "launch", "program": "${workspaceFolder}/main.js" }
]
}