Closed dornbirndevelops closed 3 months ago
Thanks for bringing this up :) I was also stumbling over that issue as rebasing branches containing CMakePresets also doesn't consistently trigger a preset reload. Up to now my approach was to close and reopen VS Code – "Reload Window" works much better and faster.
Would highly appreciate if a preset reload could be triggered from somewhere in the plugin.
@andreas-kurz @dornbirndevelops Does opening the presets file and saving it again work? Assuming you have the cmake.configureOnEdit
setting enabled, I believe this should work
Does opening the presets file and saving it again work? Assuming you have the
cmake.configureOnEdit
setting enabled, I believe this should work
Thank you for responding to my issue @andreas-kurz and @gcampbell-msft !
I just tried your suggestion with setting "cmake.configureOnEdit": true
and changing CMakeUserPresets.json
and CMakeLists.txt
, unfortunately without the desired outcome.
It appears that the setting does nothing if no configure preset is selected.
In our project cmake.configureOnEdit
is set to true from the beginning. It seems that is only watching for files likeCMakeLists.txt
– at least the comment for the settings says this. Also, we are not using CMakeUserPresets – just CMakePresets.json
So CMakePresets are somewhat different and I don't know what makes the cmake extension parse these files despite a Reload Window
which is much better than completely closing and re-opening vs code.
Therefore an option to re-parse the settings would be great or some way of auto-re-parsing if the extension detects changes to the CMakePresets (which also supports includes!).
@andreas-kurz The current implementation should be reparsing on every save of the CMakePresets.json
, especially in the most recent version of the pre-release (as of 1.19.44).
Thanks for the hint with "pre-release" – didn't noticed that before :)
I'll test it and will provide feedback – maybe next week as in Germany it's almost weekend ;)
How long does it usually take until pre-release feature make it into the actual release?
Edit: I was too curious and justed tested the pre-release version of the extension. Works like a charm =)
Our setup is having a CMakePresets.json with multiple levels of includes and no matter where I do changes it's always automatically reparsed with the respective output. So that feature seems to work (on my machine).
Thanks and have a nice weekend :)
Thanks for the confirmation! @andreas-kurz
Thanks, it already made it to the Release :)
Just switched back and edited some presets and includes and every edit triggered the reparsing of the presets with includes <3
Hello @gcampbell-msft !
I also just tried the pre-release version v1.19.46
.
I set "cmake.configureOnEdit": true
and generated the CMakeUserPresets.json
(there was none before).
This did not work out for me unfortunately, as it did not parse the newly added presets file.
Since the issue is not solved (at least for me), could you maybe reopen this issue or should I create a new one?
EDIT: To my surprise, it is now also unable to parse the CMakeUserPresets.json
file, even after reloading!
@dornbirndevelops Please create a new issue and we will investigate. Any information about how it's not able to parse would be exceedingly helpful. If it's unable to parse the file, there is either something wrong with your presets file, or there is a bug on our end. Thanks!
Thanks for the quick reply. I will make a new issue then.
Brief Issue Summary
In my daily development work, I mostly work with CMake projects in combination with the C/C++ Package Manager conan.
CMakePresets.json
are usually not checked in to my source code, but I rather rely on the generatedCMakeUserPresets.json
. Sometimes I either open the project in VS Code without running conan first, or I clean all generated files from the project by removing all files under gitignore.(Re-)generating the presets does not appear to be recognized by the extension. The only thing that helps in this situation is to use the
Developer: Reload Window
command. It would be nice to have a command that just re-attempts parsing the local preset files which were created in the meantime without having to reload the whole window.CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
open project with no preset files
open project after generating preset files
open project with preset files after manual window reload