Formatter: Initial support for formatting Objective-C method expressions.
This follows the approach suggested by djasper in PR14911: When a '[' is seen that's at the start of a line, follows a binary operator, or follows one of : [ ( return throw, that '[' and its closing ']' are marked as TT_ObjCMethodExpr and every ':' in that range that isn't part of a ternary ?: is marked as TT_ObjCMethodExpr as well. Update the layout routines to not output spaces around ':' tokens that are marked TT_ObjCMethodExpr, and only allow breaking after such tokens, not before. Before: [self adjustButton : closeButton_ ofKind : NSWindowCloseButton]; Now: [self adjustButton:closeButton_ ofKind:NSWindowCloseButton]; llvm-svn: 172304
Loading
Please register or sign in to comment