VSC 使用Clang-format 時報錯:write EPIPE而不能使用自動格式

問題

 VSC 1.34.0 使用Clang-format 時報錯:write EPIPE而不能使用自動格式html

解決方法

填寫clang-format運行位置的絕對路徑app

"clang-format.executable" : "C: \\ Users \\ Administrator \\ .vscode \\ extensions \\ ms-vscode.cpptools-0.23.1 \\ LLVM \\ bin \\ clang-format"
}

 

個人配置

當前路徑下建立文件:.clang-format, 內容以下:oop

# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# The .clang-format file uses YAML format:
# Example of usage:
BreakBeforeBraces: Custom
BraceWrapping:
  AfterEnum: true
  AfterStruct: false
  SplitEmptyFunction: false
AlignConsecutiveAssignments: true
AlignOperands: true
AllowShortLoopsOnASingleLine   : true
AlwaysBreakBeforeMultilineStrings : false
AlwaysBreakTemplateDeclarations : true
SpaceBeforeAssignmentOperators : true
SpacesBeforeTrailingComments : 3
TabWidth : 2spa

相關文章
相關標籤/搜索