【发布时间】:2021-01-08 17:24:41
【问题描述】:
其实我的选择是:"C_Cpp.clang_format_fallbackStyle": "{ BreakBeforeBraces: Linux, IndentWidth: 4, ColumnLimit: 80, UseTab: Never, SortIncludes: false, AlignAfterOpenBracket: DontAlign }"
我有:
for (int i = 0; i < 5; i++)
;
我想要:
for (int i = 0; i < 5; i++);
【问题讨论】:
-
第一个更清楚地表明空循环不是错误。如果是这样,它更容易吸引注意力。
-
其实clang其实对第二种形式给出了警告,建议使用第一种形式。
-
@AdrianMole 是否也对第一个版本发出警告?
-
@WeatherVane 不。我想这就是它建议的原因。
-
所以 clang 是在警告代码排版风格,而不是它的功能?
标签: c++ c visual-studio-code formatter