Clang_format_path 显然不是我需要的,因为它指定了 clang 可执行文件的路径:
C_Cpp: Clang_format_path:clang-format 可执行文件的完整路径。如果未指定,并且在环境变量路径中可用,则使用该路径。如果在环境变量路径中找不到,则将使用扩展程序捆绑的 clang-format 副本。
然后有 Clang_format_style。
C_Cpp: Clang_format_style:编码风格,目前支持:Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit。使用“file”从当前或父目录中的 .clang-format 文件加载样式。使用 {key: value,...} 设置特定参数。例如,“Visual Studio”风格类似于:{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4 }
我可以将其设置为“file”,但是如何指定文件的位置呢?