Hi everyone,
I found a solution for a common issue when using the official STM32Cube for VS Code extension. If you disable the Microsoft C/C++ (ms-vscode.cpptools) extension to avoid IntelliSense conflicts, you might notice that "Format Document" stops working completely.
The reason is that the STM32 extension's built-in clangd has its formatting engine disabled by default.
To fix this:
- Go to VS Code Settings (Ctrl + ,).
- Search for: stm32cube-ide-clangd.enableFormatting.
- Check the box to enable it.
- If prompted, set "STM32Cube for VS Code" as your Default Formatter.
This allows you to have working formatting and precise IntelliSense without any conflicts from the Microsoft extension. Hope this helps!