[PATCH] D17700: [clang-format] Proposal for changes to Objective-C block formatting

Tony Arnold via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 28 18:48:20 PST 2016


tonyarnold added a comment.

I did find one bug though — if there's any parameters in between the two blocks, they'll end up forcing a newline:

  objective-c
  @implementation SomeClass
  
  - (void)test
  {
          [sharedController passingTest:^BOOL(id application) {
              return application.thing;
          } withTimeout:kTimeout completionHandler:^(BOOL success, NSError *error) {
              if (success == NO && error != nil)
              {
                // Do the thing
              }
          }];
      }
  }
  
  @end

Wrongly becomes:

  objective-c
  @implementation SomeClass
  
  - (void)test
  {
      [sharedController passingTest:^BOOL(id application) {
          return application.thing;
      } withTimeout:kTimeout
          completionHandler:^(BOOL success, NSError *error) {
              if (success == NO && error != nil)
              {
                  // Do the thing
              }
          }];
  }
  }
  
  @end


http://reviews.llvm.org/D17700





More information about the cfe-commits mailing list