如何告诉 vs code 在哪里查找 .clang_format 文件?我的这个文件所在的位置不是我的 vscode 项目的根目录。Clang_format_path 显然不是我需要的,因为它指定了 clang 可执行文件的路径:
C_Cpp: Clang_format_path clang-format 可执行文件的完整路径。如果未指定,并且 clang-format 在环境路径中可用,则使用该格式。如果在环境路径中找不到,则将使用与扩展捆绑在一起的 clang-format 副本
然后是 Clang_format_style。
C_Cpp:Clang_format_style编码风格,目前支持:Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit。使用“file”从当前目录或父目录中的 .clang 格式文件加载样式。使用 {key: value, ...} 设置具体参数。例如,“Visual Studio”样式类似于: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4 }
我可以将其设置为文件,但如何指定在哪里查找该文件?
我在工作区中有两个项目,一个是.js文件,另一个是带.cpp文件的。
当我想美化.cpp文件时,会弹出以下内容:
从 File -> Preferences -> Extensions,这里是以下启用的扩展:
我如何为 C++ 文件使用Beautify扩展?