Issue |
135269
|
Summary |
clang-format: better continuation indent options for BraceWrapping=false
|
Labels |
|
Assignees |
|
Reporter |
belm0
|
With `BraceWrapping` set to false, readability is impacted when the opening of a code block includes continuation indents, causing the continued lines and the first line of the body to have the same indent level:
```C++
Foo::Bar::Result<Foo::Bar::Type1, Foo::Bar::Type2> exampleFunction(
const SomeType& arg1, const AnotherType& arg2) {
auto variable = someValue;
...
```
I'd like the continuations to be double-indented, but `ContinuationIndentWidth` is coarse and applies to too may cases where I don't want additional indent (function calls, etc.).
So perhaps add an option like UnwrappedBraceContinuationIndent that will apply to continued lines prior to an unwrapped brace.
```C++
// with UnwrappedBraceContinuationIndent: 8
Foo::Bar::Result<Foo::Bar::Type1, Foo::Bar::Type2> exampleFunction(
const SomeType& arg1, const AnotherType& arg2) {
auto variable = someValue;
auto another_var = very_long_function_call(const Baz& arg1, const Baz& arg2,
const Baz& arg3); // NOTE: regular continuation indent
...
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs