microsoft / microsoft/vscode-cpptools

Configuration: Inherit Other Configs

Open
#6,654 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Configuration help wanted Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how the C/C++ extension currently loads and selects configurations; the issue names no files or tests. Compare the proposed basedOn example with existing configuration behavior, and consider the work complete when a derived configuration inherits fields and overrides defines.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.