microsoft / microsoft/vscode-cmake-tools
cmake.defaultVariants doesn't override default buildType, but appends
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Brief Issue Summary
When using the `cmake.defaultVariants` setting, the values used in the `buildType` entry are appended to the defaults instead of replacing them.
For example the following setting value:
```json
"cmake.defaultVariants": {
"buildType": {
"default": "beepbeep",
"description": "The build type.",
"choices": {
"beepbeep": {
"short": "Beep Beep",
"long": "This build goes beep beep",
"buildType": "Beep"
},
}
}
}
```
Gives the following list of variants:

This happens both with simple folder workspaces, and `.code-workspace` workspaces.
### CMake Tools Diagnostics
_No response_
### Debug Log
```shell
There is no additional debug info printed beyond "[variant] Loaded new set of variants"
```
### Additional Information
_No response_
Contributor guide
Research direction
Start by tracing how the cmake.defaultVariants setting is loaded and how the buildType entry is merged when the variant list is produced; the debug log identifies this as the "[variant] Loaded new set of variants" path. Verify the behavior for both folder and .code-workspace workspaces, and consider the issue done when custom buildType values replace rather than append to the defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100