相关疑难解决方法(0)

如何控制链接方法调用的clang格式缩进?

我希望结果看起来像这样:

auto foo = FooBuilder()
    .WithSomething()
    .WithSomethingElse()
    .Build();
Run Code Online (Sandbox Code Playgroud)

但改为这样clang-format格式化:

auto foo = FooBuilder()
               .WithSomething()
               .WithSomethingElse()
               .Build();
Run Code Online (Sandbox Code Playgroud)

我希望链式调用相对于上一行的开始而不是相对于FooBuilder()调用缩进。我在clang-format控制此的选项中看不到任何东西。设置ContinuationIndentWidth无济于事。有任何想法吗?

c++ indentation clang-format

5
推荐指数
1
解决办法
180
查看次数

标签 统计

c++ ×1

clang-format ×1

indentation ×1