Set Up Debug Launch for All Workspaces in VSCode

Yuki Shibazaki
1 min readJan 16, 2023

Before, I always added .vscode/launch.json to each workspace to launch a debugger in VSCode. I always think I don’t want to do it every time.

But recently, I found a way to set up debug launch configuration for all workspaces. We can use the key called `launch` in settings.json.

For example, if you use vscode-rdbg to debug a ruby program, you can set up the following in .vscode/settings.json to launch debugger in all workspaces. This setting allows you not to need to set up each workspace.

  "launch": {
"version": "0.2.0",
"configurations": [
{
"type": "rdbg",
"name": "Debug current file with rdbg",
"request": "launch",
"script": "${file}",
"args": [],
"askParameters": true
},
{
"type": "rdbg",
"name": "Debug current test with rdbg",
"request": "launch",
"command": "rspec",
"script": "${file}",
"args": [],
"askParameters": false
}
]
}

See Also:
* https://github.com/ruby/vscode-rdbg
* https://code.visualstudio.com/docs/getstarted/settings#_default-settings

--

--