Before:
@property(nonatomic, assign,
readonly) NSString *looooooooooooooooooooooooooooongName;
After:
@property(nonatomic, assign, readonly)
NSString *looooooooooooooooooooooooooooongName;
llvm-svn: 187577
}
// Breaking before a trailing 'const' or not-function-like annotation is bad.
- if (Left.is(tok::r_paren) &&
+ if (Left.is(tok::r_paren) && Line.Type != LT_ObjCProperty &&
(Right.is(tok::kw_const) || (Right.is(tok::identifier) && Right.Next &&
Right.Next->isNot(tok::l_paren))))
return 150;
return true;
if (Right.Type == TT_ObjCSelectorName)
return true;
+ if (Left.is(tok::r_paren) && Line.Type == LT_ObjCProperty)
+ return true;
if (Left.ClosesTemplateDeclaration)
return true;
if (Right.Type == TT_ConditionalExpr || Right.is(tok::question))
"@optional\n"
"@property(assign) int madProp;\n"
"@end\n");
+
+ verifyFormat("@property(nonatomic, assign, readonly)\n"
+ " int *looooooooooooooooooooooooooooongNumber;\n"
+ "@property(nonatomic, assign, readonly)\n"
+ " NSString *looooooooooooooooooooooooooooongName;");
}
TEST_F(FormatTest, FormatObjCMethodDeclarations) {