]> granicus.if.org Git - clang/commit
[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style
authorBen Hamilton <benhamilton@google.com>
Thu, 14 Dec 2017 16:17:38 +0000 (16:17 +0000)
committerBen Hamilton <benhamilton@google.com>
Thu, 14 Dec 2017 16:17:38 +0000 (16:17 +0000)
commit71ce0c7b2f8fd0ac63ffa523992e4a832a285ea2
tree6a1acafd98717a398510987b06b4315d864cc37e
parentb007293d31c4fbcd73592302a948fb3bac5d36a7
[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style

Summary:
If we write the following code, it goes over 100 columns, so we need to wrap it:

```
- (VeryLongReturnTypeName)veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
                              longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```

Currently, clang-format with the google style aligns the method parameter names on the first column:

```
- (VeryLongReturnTypeName)
veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
    longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```

We'd like clang-format in the google style to align these to column 4 for Objective-C:

```
- (VeryLongReturnTypeName)
    veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
            longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```

Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, djasper, klimek

Reviewed By: djasper

Subscribers: cfe-commits, thakis

Differential Revision: https://reviews.llvm.org/D41195

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320714 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
unittests/Format/FormatTestObjC.cpp