microsoft/vscode

Allow us to extend launch configurations

Closed this issue · 4 comments

I have a launch.json with two configurations that are basically exactly the same except for the args that I set.

I would like to be able to extend an existing launch configuration and add on just my changes rather than rewriting the entire configuration. E.g.:

{
    "type": "node",
    "request": "launch",
    "name": "A",
    "program": "...",
    "runtimeExecutable": "...",
    ...
},
{
    "name": "B",
    "extends": "A",
    "args": ["arg1", "arg2"]
}
    

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

Can we revisit this? I have giant launch configs. My current workaround is to comment out the arguments to test with but it's a pain to switch between when it could be in a nice dropdown menu.

I really like pushkin-'s idea. It's simple and exactly what I need. It could be implemented at a more generic level, where we could "include" a json block anywhere (although more invasive). This would be really useful for c_cpp_properties.json too, where I am copy/pasting giant blocks of include and search paths.

"environment": [ <project-wide-env-vars> ],
"setupCommands": [ <project-wide-gdb-setup-comands> ],

would be great to have

This would allow different folks on the team to change launch configurations to use either Chrome or Edge based on their preference without generating a Git change.

Current state:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug config",
            "type": "msedge",
            ...
        },

Ideal state:

{
    "extends": "launch.local.json",
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug config",
            ...
        },

launch.local.json:

{
    "configurations": [
        {
            "type": "msedge",
        },

Of course, how to merge the configs would be a discussion to have for sure so both augmenting and completely replacing configuration nodes would be possible.