Skip to content

Commit

Permalink
Fix configure preset used in workflow preset defined in CMakeUserPres…
Browse files Browse the repository at this point in the history
…ets.json (#4202)

* Fix workflow preset configure in user presets

Previously, when workflow preset in CMakeUserPresets.json references
configure preset that is also defined in CMakeUserPresets.json,
this extension reports an error that the configure preset can't be
found.
And that results in the CMakeUserPresets.json getting ignored along
with all presets defined in it.

This commits fixes this problem by adding a lookup from
userConfigurePresets in case the configure preset isn't found in
configurePresets.

* Add CHANGELOG entry

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
  • Loading branch information
nikobockerman and gcampbell-msft authored Dec 10, 2024
1 parent db8cb8a commit 5bed54c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bug Fixes:
- Ensure that tests are updated after a build. [#4148](https://github.com/microsoft/vscode-cmake-tools/pull/4148)
- Fix various GCC compiler errors and GCC linker errors not showing up in Problems View [#2864](https://github.com/microsoft/vscode-cmake-tools/issues/2864)
- Fix reloading presets when included files are changed or renamed and updated. [#3963](https://github.com/microsoft/vscode-cmake-tools/issues/3963)
- Fix parsing of CMakeUserPresets.json containing configure preset that is referenced in workflow preset. [#4202](https://github.com/microsoft/vscode-cmake-tools/pull/4202)

## 1.19.52

Expand Down
3 changes: 3 additions & 0 deletions src/presets/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,9 @@ async function getWorkflowPresetInheritsHelper(folder: string, preset: WorkflowP
errorHandler);
} else {
expandedConfigurePreset = getPresetByName(configurePresets(folder), workflowConfigurePreset);
if (!expandedConfigurePreset && allowUserPreset) {
expandedConfigurePreset = getPresetByName(userConfigurePresets(folder), workflowConfigurePreset);
}
}
if (!expandedConfigurePreset) {
log.error(localize('configure.preset.not.found.full', 'Could not find configure preset with name {0}', workflowConfigurePreset));
Expand Down

0 comments on commit 5bed54c

Please sign in to comment.