vscode-cmake-tools
vscode-cmake-tools copied to clipboard
[Bug] $comment in a preset is not accepted inside a cacheVariable
Brief Issue Summary
While
"cacheVariables": {
"$comment": "My comment",
"CMAKE_EXE_LINKER_FLAGS": {
"type": "STRING",
"value": "-Wno-error=free-nonheap-object"
}
}
is accepted,
"cacheVariables": {
"CMAKE_EXE_LINKER_FLAGS": {
"type": "STRING",
"$comment": "My comment",
"value": "-Wno-error=free-nonheap-object"
}
}
is not.
CMake itself does accept the "$comment" in there, with the documentation saying
Preset files specifying version 10 or above may include comments using the key $comment at any level within the JSON object to provide documentation.
CMake Tools Diagnostics
Not needed.
Debug Log
Not needed.
Additional Information
No response
Hi @cmorve-te, thanks for reporting issue here! We can reproduce this issue on VS Code 1.105.1 + CMake tools 1.21.36 version. Repro Steps:
- Create a new folder and quick start a new CMake project .
- Open CMakePresets.json, add the following code.
"CMAKE_EXE_LINKER_FLAGS": {
"type": "STRING",
"$comment": "My comment",
"value": "-Wno-error=free-nonheap-object"
},
- Observe the result.
Details please see following video:
@gcampbell-msft