Good day @CSharpino I am assuming the attached clang-format.txt file was renamed to clang-format.txt so that it could be attached to the comment. Please note that if you used the file as is, clangd would default to the LLVM style, which formats braces on the same line. Also note that I used your clang-format file and encountered an error. I believe it was AlignFunctionDeclarations. This is not supported by the starm-clangd executable and clangd is very unforgiving to non-recognised keys. This will result in it defaulting to LLVM style, which may be the case for you.
If you have generated a clang-format file using a later version using a style, it will use every key available in its arsenal. My advice to you would be to make your own .clang-format file and copy out options from here Clang-Format Style Options — Clang 22.0.0git documentation based on what you want. Each option will have a version associated with it and if you ensure you only use options that are version 18 and less, you will be ok. This is time consuming, but it allows complete customisation of how you want things styled.
I have attached a clang-format file that I generated based on Microsoft style using clang-format version 18.1.3 and this correctly formats my files when I tested it. Please download this, rename to .clang-format and copy it to the root of your project. You can always tweak the options as you see fit.
Anyway, one thing that I do that prevents headaches like the one you encounter with conflicting extensions is to create profiles and only install extensions that are required so my best advice is to create a new profile, name it STM32 and only install the stm32cubeide extension pack.