I keep setting up the same launch.json file per project. But I would like to change the default one so it's already got the launch targets configured.
Can I change the default one, or is it possible to create a user one? I'm using it on Mac OS X.
I keep setting up the same launch.json file per project. But I would like to change the default one so it's already got the launch targets configured.
Can I change the default one, or is it possible to create a user one? I'm using it on Mac OS X.
See https://code.visualstudio.com/docs/editor/debugging#_global-launch-configuration.
VS Code supports adding a "launch" object inside your User settings. This "launch" configuration will then be shared across your workspaces. For example:
"launch": { "version": "0.2.0", "configurations": [{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${file}" }] }
Historical note: According to other writings, in certain older versions of VS Code, if your workspace had its own .vscode/launch.json, the global launch configs would be ignored, but it seems that this is no longer true in the latest versions (I tried on 1.78) for the user settings.json. It is still true that the workspace settings.json's launch
property will be ignored if you have a launch.json file in your workspace.
https://code.visualstudio.com/docs/editor/variables-reference will probably also be useful to you.