-
Notifications
You must be signed in to change notification settings - Fork 461
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
CMakePresets.json no longer supports comments #2169
Comments
This would be really helpful! Right now our projects have the CMake Tools plugin locked back @1.7.3 until this feature is re-enabled. |
We actually supported it before, but according to CMake release notes, it is not supposed to be supported: https://cmake.org/cmake/help/latest/release/3.19.html#id6 A bug was opened against us to remove the support and we did it because it matched the documented behavior: #2035 It's a bug in CMake that comments are currently allowed. We were trying to be helpful, but it turns out CMake accepts comments that are not at the top of the JSON file because there's a bug in the library they use. 🤦♂️ EDIT: duplicate: #2104 |
Thanks @bobbrow - can it be added back with a setting to enable/disable it? It's REALLY really helpful... |
I'm actually happy to go either way with this. If folks want to advocate to Kitware that JSONC should be accepted, it would probably help if folks could comment on the issue I linked above. We can also consider a setting to allow the comments in the meantime. |
I think comments in json used for config files is very helpful. So CMake should support comments. |
I opened a PR to add a setting for this. We can try to push it into 1.9 (which we intended to release today) if there's time or I can build a separate VSIX shortly after. |
The setting will be included with 1.9 hopefully later today. |
Thank you. Could you please advocate for including comments in CMake and Visual Studio 22 because cross-IDE support is also the point of this feature. |
This fix is included in the 1.9.0 CMake Tools release. Please upgrade your extension in VSCode and let us know if you encounter any other issues. |
Brief Issue Summary
In 1.7.3, you could use comments ( // ) in CMakePresets.json and everything worked fine. Starting with 1.8.0, cmake tools fails to parse CMakePresets.json if it has comments in it. While comments aren't officially allowed in json, many tools allow it, and it's not hard to support. It is also REALLY helpful to be able to document your presets file!
Debug Log
The text was updated successfully, but these errors were encountered: