vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Configuration: Inherit Other Configs

Open TurtleP opened this issue 5 years ago • 4 comments

General Info

  • OS and Version: Microsoft Windows [Version 10.0.19042.685]
  • VS Code Version: 1.52.0
  • C/C++ Extension Version: 1.1.3

Describe the Feature

I don't think this feature has been requested yet, so I figured I'd toss it in: I have some configurations for a C++ project which by default are non-debug defined configurations. These will have all of my paths and custom variables I would like to normally use if I don't want to compile a debug version. However, I would like for configurations to be able to inherit a previously created configuration's data to its own so I can override specific fields. For example:

{
    "configurations":
    [
        {
            "name": "Test",
            "includePath": [ ... ],
            "compilerPath": ...
            "browse":
            {
                "path":
                [ 
                    ... 
                ]
            }
            "defines": [ ]
        },
        {
            "name": "Test {Debug}",
            "basedOn": "Test",
            "defines": [ "__DEBUG__" ]
        }
    ]
}

In this instance, creating the "debug" variant of Test will automatically use the fields from that configuration and then override the defines section with its own.

References

Please let me know if there's any other information I can provide.

TurtleP avatar Dec 11 '20 20:12 TurtleP

One existing way to "inherit" is to use the C_Cpp.default.* workspace folder settings for the settings you want to inherit and then each config can override the other ones.

sean-mcmanus avatar Dec 12 '20 00:12 sean-mcmanus

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] avatar Mar 23 '21 11:03 github-actions[bot]

Would be very useful for us too.

evyaco avatar Mar 10 '22 18:03 evyaco

This feature request has received enough votes to be added to our backlog.

github-actions[bot] avatar Oct 15 '24 12:10 github-actions[bot]