Before:
- (instancetype)initXxxxxxxxxxxxxxxxxxxxxxxxx:(id<x>)x
y:(id<yyyyyyyyyyyyyyyyyyyy>)
y NS_DESIGNATED_INITIALIZER;
After:
- (instancetype)initXxxxxxxxxxxxxxxxxxxxxxxxx:(id<x>)x
y:(id<yyyyyyyyyyyyyyyyyyyy>)y
NS_DESIGNATED_INITIALIZER;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219564
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Right.Type == TT_TrailingAnnotation &&
(!Right.Next || Right.Next->isNot(tok::l_paren))) {
+ // Moving trailing annotations to the next line is fine for ObjC method
+ // declarations.
+ if (Line.First->Type == TT_ObjCMethodSpecifier)
+
+ return 10;
// Generally, breaking before a trailing annotation is bad unless it is
// function-like. It seems to be especially preferable to keep standard
// annotations (i.e. "const", "final" and "override") on the same line.
" evenLongerKeyword:(float)theInterval\n"
" error:(NSError **)theError {\n"
"}");
+ verifyFormat("- (instancetype)initXxxxxx:(id<x>)x\n"
+ " y:(id<yyyyyyyyyyyyyyyyyyyy>)y\n"
+ " NS_DESIGNATED_INITIALIZER;",
+ getLLVMStyleWithColumns(60));
}
TEST_F(FormatTest, FormatObjCMethodExpr) {