Skip to main content
Visitor II
March 17, 2026
Question

Solved: Code formatting stops working after disabling Microsoft C/C++ extension

  • March 17, 2026
  • 2 replies
  • 465 views
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:
  1. Go to VS Code Settings (Ctrl + ,).
  2. Search for: stm32cube-ide-clangd.enableFormatting.
  3. Check the box to enable it.
  4. 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!
 

2 replies

Cartu38 OpenDev
Graduate II
March 17, 2026

@j9-ok 
Cannot claim to fix ... as not a bug but a feature.
See https://community.st.com/t5/stm32cubeide-for-visual-studio/what-s-the-recommended-cli-environment-variable-path-after-vs/td-p/885901
Disabling formating by default has been asked by this community ....

ST Employee
July 21, 2026

@j9-ok 
The July update of STM32CubeIDE for Microsoft Visual Studio Code resolves this issue adding more information. Update the local setup to benefit from this improvement.
 


 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.