Skip to content
Snippets Groups Projects
  • Nico Weber's avatar
    bcfdd263
    Formatter: Initial support for formatting Objective-C method expressions. · bcfdd263
    Nico Weber authored
                                                                                     
    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];
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172304 91177308-0d34-0410-b5e6-96231b3b80d8
    bcfdd263
    History
    Formatter: Initial support for formatting Objective-C method expressions.
    Nico Weber authored
                                                                                     
    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];
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172304 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.