cmake_format
cmake_format copied to clipboard
Windows installation procedure for VSCode
Hi! Could you please git it working for me?
- I've install Python latest version,
- in VSCode i've installed cmake-format extension
- should I do something more?..
In VSCode I open CMakeLists.txt, select "Format Document" command - nothing happens :(
Thank you in advance
If you still haven't gotten this working, you may want to do the following:
- Open the command palette (Ctrl+Shift+P)
- Type 'sett' and select "Preferences: Open User Settings (JSON)"
- Add exePath and args to the existing JSON; see below for an example
- Save the changed JSON file and close the document
At this point, you should be able to invoke the "Format Document" command, as you noted above and should see you CMakeLists.txt file change.
Note, to get the format file, with settings, you have to export it from cmake-format.exe and make changes as required:
cmake-format.exe --dump-config python > sample-settings.py
Hope this helps.
Example JSON settings:
{
"editor.fontFamily": "MesloLGM Nerd Font Mono",
[...]
"cmakeFormat.exePath": "C:\\FillInYourPythonPath\\Scripts\\cmake-format.exe",
"cmakeFormat.args": ["--config-file", "C:\\FillInYourPreferredDocPath\\my_cmake_format.py"]
}
See my latest comment on #242 Hope it helps :)