Skip to main content
Associate
October 3, 2026
Question

Why doesn't STM32Cube for VSCode have a code formatting feature?

  • October 3, 2026
  • 8 replies
  • 80 views

Why doesn't STM32Cube for VSCode have a code formatting feature? It clearly shows that “stm32cube clangd” is installed, but pressing Alt+Shift+S and selecting “Format” doesn't work. I'm using the Trae IDE.

 

*This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

    8 replies

    Cartu38 OpenDev
    Graduate II
    October 3, 2026

    ​@STM_student 

    Absolutely, but you'll need to enable it. Please refer to the relevant preferences.

    *This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

     

    Visitor II
    October 3, 2026

    I’ve encountered a similar issue before—even though clangd was already installed, pressing the shortcut key didn’t format the code.
    You can start by checking the specific preferences to see if the code formatting feature is enabled.
    You might also want to check if the problem started after upgrading to 3.8.0.
    If it was working fine before and suddenly stopped working after the upgrade, the version change is likely worth investigating.
    It’s easier to check the settings and clangd configuration first before considering a reinstallation.

     

    *This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

    Cartu38 OpenDev
    Graduate II
    October 3, 2026

    ​@STM_student ​@stephenie

     

     

    Associate
    October 3, 2026

    I see. I'll give it a try tomorrow.

     

    *This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

    Visitor II
    October 4, 2026

    I hope you'll be able to fix it when you try it tomorrow.

    *This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

    Associate
    October 4, 2026

    It worked after all—thanks. I hadn't turned this setting on before.

    *This post has been translated from Chinese to comply with the ST Community guidelines (Article 10.2).

    Cartu38 OpenDev
    Graduate II
    October 6, 2026

    ​@STM_student 
    Could you tag this post as answered success ? Will help other freaks !