'visual studio can't apply clang-format 13

I'm expecting to use AlignArrayOfStructures, however it's only available in clang-format 13. So I set Custom clang-format.exe to C:/Program Files/LLVM/bin/clang-format.exe.

PS C:\Program Files\LLVM\bin> .\clang-format.exe --version
clang-format version 13.0.0

But I still got a error, it says enter image description here



Solution 1:[1]

Reading the manual carefully.

AIAS_Right (in configuration: Right)

AIAS_Right is the enum value, corresponding name in the config is Right. Use

AlignArrayOfStructures: Right

Solution 2:[2]

vs2019 clang-format version ->12.0.0 enter image description here

vs2022 clang-format version ->13.0.0 enter image description here

AlignArrayOfStructures: Lefe/Right required 13.0.0 enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 273K
Solution 2 Emerson Jiang