To utilize the VSCode’s JSON completion, The CMakePresets.json must contain the “$schema” entry at the top-level. But cmake.exe refuses this ( say “Invalid root object”).
In my opinion, the VSCode extension should recognize
CMakeUserPresets.json, and apply the appropriate schema automatically. Nevertheless, perhaps it does make sense to allow a
$schema key anyway.
Now VSCode knows about the CMakePresets.json schama.