Closed qarni closed 4 months ago
Comment to remind to test these changes for this issue as well: #2934 , just wanted to remind since it's not a devenv issue, we don't want to forget it.
TODO's for follow up:
applyDevEnv
to decouple from expandConfigurePreset
@qarni We verified the two issue:https://github.com/microsoft/vscode-cmake-tools/issues/2934 and https://github.com/microsoft/vscode-cmake-tools/issues/2781 of this PR fix in CMake Tools: v1.19.45 and here are the results:
Issue:https://github.com/microsoft/vscode-cmake-tools/issues/2934
Selecting a configuration preset has been fixed: Selecting a build preset is not fixed: I'm not sure if I'm not understanding your fix correctly, can you give me some advice?
Issue:https://github.com/microsoft/vscode-cmake-tools/issues/2781 This issue has been fixed
Fixes #2934, #2781.
This change changes the way we do preset file expansion. Expansion now occurs upfront on file open or save, and if there are no errors, the expanded presets will be cached so repeated expansion is not necessary every time
getAll{type of preset}Presets()
is called.The only time expansion will happen again is on set preset, which will then also apply the VS developer environment as needed. This is avoided on the initial expansion for performance.
If there are errors in expansion, the errors are shown in the problems panel per file. The presets file will also be set to undefined, which will invalidate that file and not allow any presets in that file to be recognized/selected as valid presets. This is in line with the CMake command line experience.
Some notes: