我一直在使用clang格式来帮助保持代码的整洁。对于多行函数调用,有什么方法可以让clang在它自己的行上插入结束括号呢?
示例:
它现在在做什么:
increment_and_call_on_match(
clique_colors,
0,
max_clique_color,
[&](int clique_color) {
comms.emplace_back(context.split_by_color(clique_color));
},
[&](int) { context.split_by_color(); });我想要的:
increment_and_call_on_match(
clique_colors,
0,
max_clique_color,
[&](int clique_color) {
comms.emplace_back(context.split_by_color(clique_color));
},
[&](int) { context.split_by_color(); }
); //Closing paren on new line发布于 2018-12-26 18:19:07
在已批准的代码评审https://reviews.llvm.org/D109557中,在LLVM 14.0.0-rc1或更高版本中添加了一个新的选项LLVM 14.0.0-rc1。
(我也想这样做,因为我们有成千上万行使用这种样式的代码,而支持这种样式的clang格式将使我在VisualStudio-https://developercommunity.visualstudio.com/content/problem/232465/clang-format-messes-with-closing-parentheses-in-fu.html中采用clang格式)
https://stackoverflow.com/questions/50689027
复制相似问题