应用clang-format对c++代码时进行格式化
1. VS Code
settings.json文件
{ // "C_Cpp.clang_format_fallbackStyle": "Google", "C_Cpp.clang_format_path": "D:/GreenSoftware/CPlusPlus/ClangLLVM/bin/clang-format.exe", "C_Cpp.clang_format_style": "file:D:/GreenSoftware/CPlusPlus/ClangLLVM/format-styles/.clang-format-microsoft", "clangd.enableCodeCompletion": false, ...... }
2. Qt Creator
帮助 –》 关于插件
重启Qt Creator
将.clang-format-microsoft重命名为.clang-format,放在.pro或.sln同目录下


浙公网安备 33010602011771号