2025-11-05 9:15 AM
Since I upgraded to version 3.6.4 of STM32CubeIDE for Visual Studio Code, the style used for automatic code formatting has changed. For example, curly braces are now inlined, not wrapped as they were before.
How can I revert to the old style?
Solved! Go to Solution.
2025-12-05 6:20 AM
What about clang-format usage ? https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
cllangd is out of LLV project like clang-format. Clang-format is dedicqted to while clangd is in real language server LLVM project has kept pieces of clang-format into. Maybe pieces are not rocking enough ?
Same FYI clangd integrates pieces of clang-tidy which is about linter feature .... but another story
2025-12-06 1:26 PM - edited 2025-12-06 1:38 PM
With your testing on the 900kb header. How did you generate the .clang-format file for the STM32 fork of clangd to use.
And when you say it failed, what do you mean exactly? Did it format it incorrectly or not at all? Or did you notice an error in the output window?
The LLVM tools for formatting are very picky about what style options are present in the .clang-format file. Any wrong key would just throw an internal error and might format using a fallback style, which is LLVM, or it not do anything at all.
I tried a test on a 200kb file as I couldn't find a larger one and using clangd-22, it was able to format the header file correctly.