-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hidden CMake presets picked up at first configuration - project outline empty #2976
Comments
Following the current steps, I am not able to repro this issue. |
It's one project in a subfolder of the root folder (handled in the CMakePreset.json). I'll try to set up a minimal example to repro the issue. |
I could repro in a single project with these steps: However, please share your steps, if it's different. |
I have a setup to reproduce the issue. It's 3 files:
Versions
Procedure (updated)
After configure is complete, two problems are:
The files
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.allowUnsupportedPresetsVersions": true,
"cmake.configureOnEdit": false,
"cmake.configureOnOpen": false,
"cmake.sourceDirectory": "${workspaceFolder}/cxx"
}
cmake_minimum_required(VERSION 3.25)
project(testcase LANGUAGES CXX)
add_custom_target(echo1 COMMAND ${CMAKE_COMMAND} -E echo "This is target 1")
add_custom_target(echo2 COMMAND ${CMAKE_COMMAND} -E echo "This is target 2")
add_custom_target(echo3 COMMAND ${CMAKE_COMMAND} -E echo "This is target 3")
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "multi-config-base",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "vs-base",
"hidden": true,
"architecture": {
"value": "x64",
"strategy": "set"
},
"toolset": {
"value": "host=x64",
"strategy": "set"
},
"cacheVariables": {
"CMAKE_CONFIGURATION_TYPES": "Debug;Release;RelWithDebInfo"
}
},
{
"name": "vs2022",
"inherits": [
"windows-base",
"vs-base",
"multi-config-base"
],
"displayName": "Visual Studio 2022",
"description": "Architecture x64 - Toolset v143",
"generator": "Visual Studio 17 2022"
}
],
"buildPresets": [
{
"name": "windows-base",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "debug-base",
"configuration": "Debug",
"hidden": true
},
{
"name": "release-base",
"configuration": "Release",
"hidden": true
},
{
"name": "relwithdebinfo-base",
"configuration": "RelWithDebInfo",
"hidden": true
},
{
"name": "vs2022-base",
"configurePreset": "vs2022",
"hidden": true
},
{
"name": "vs2022-debug",
"displayName": "Debug",
"inherits": [
"windows-base",
"vs2022-base",
"debug-base"
]
},
{
"name": "vs2022-release",
"displayName": "Release",
"inherits": [
"windows-base",
"vs2022-base",
"release-base"
]
},
{
"name": "vs2022-relwithdebinfo",
"displayName": "RelWithDebInfo",
"inherits": [
"windows-base",
"vs2022-base",
"relwithdebinfo-base"
]
}
],
"testPresets": [
{
"name": "windows-base",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "debug-base",
"configuration": "Debug",
"hidden": true
},
{
"name": "release-base",
"configuration": "Release",
"hidden": true
},
{
"name": "relwithdebinfo-base",
"configuration": "RelWithDebInfo",
"hidden": true
},
{
"name": "vs2022-base",
"configurePreset": "vs2022",
"hidden": true
},
{
"name": "vs2022-debug",
"displayName": "Debug",
"inherits": [
"windows-base",
"vs2022-base",
"debug-base"
]
},
{
"name": "vs2022-release",
"displayName": "Release",
"inherits": [
"windows-base",
"vs2022-base",
"release-base"
]
},
{
"name": "vs2022-relwithdebinfo",
"displayName": "RelWithDebInfo",
"inherits": [
"windows-base",
"vs2022-base",
"relwithdebinfo-base"
]
}
],
"packagePresets": [
{
"name": "windows-base",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "release-base",
"configurations": [
"Release"
],
"hidden": true
},
{
"name": "vs2022",
"inherits": [
"windows-base",
"release-base"
],
"configurePreset": "vs2022",
"displayName": "Release"
}
]
} |
I see you have |
The |
Thanks. Yeah, I overlooked the setting. |
We have PR #2978 which should hopefully address your issue. |
PR #2978 fixed some scenarios for me (where the preset was modified between sessions), but I could repro the bug for when we needed to pick a default build preset for a config preset that was picked correctly in the previous sessions. |
@vdilecce can you please install this VSIX and let us know if this solves your issue? |
I confirm that the issue is solved in 1.13.44. Thank you! |
Brief Issue Summary
VSCode: 1.74.3
CMake Tools: 1.13.42
CPPTools: 1.13.9
At the first configuration of a project, when the CMakePresets.json contains hidden presets, the extension picks the hidden preset as default (status bar), leaving the project outline in the Activity Bar empty (verified with build presets).
Selecting a proper (non-hidden) preset, configuring again, and restarting VSCode makes the targets appear in the project outline.
Verified on Windows and Linux.
CMake Tools Diagnostics
Debug Log
No response
Additional Information
Steps to reproduce:
The text was updated successfully, but these errors were encountered: