Re: [PATCH] D9237: Update block formatting to behave like Xcode
tonyarnold added a comment. @djasper so was the decision here to not merge these options? I think it's fair that you require a documented style guide somewhere (which Apple don't currently publish), however it would be good to at least have generic options in clang-format that allow us to replicate the unpublished style, even without official support in the tool. What do we need to do to get support for options like `ObjCAvoidLineBreaksForInlineBlocks` and `ObjCLeftAlignMultipleBlocks` into clang-format? There are potentially one or two more options around dictionary/array literal alignment/newlines that I'd like to add — but I'm not going to spend any time drawing up PRs if there's no way they'll ever be merged. http://reviews.llvm.org/D9237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17700: [clang-format] Proposal for changes to Objective-C block formatting
tonyarnold added a comment. Aside from the lack of tests, and `AllowNewlineBeforeBlockParameter` being outside of `BraceWrapping`, this is good! Much closer to how Apple's documentation and Xcode format blocks! 👍 Comment at: include/clang/Format/Format.h:421 @@ +420,3 @@ + /// \brief If true, allow newlines before block parameters when ColumnLimit is 0. + bool AllowNewlineBeforeBlockParameter; + Perhaps this would be better placed within the custom `BraceWrapping` options? Something simpler like `BeforeBlockParameter`. http://reviews.llvm.org/D17700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17700: [clang-format] Proposal for changes to Objective-C block formatting
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 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17700: [clang-format] Proposal for changes to Objective-C block formatting
tonyarnold added a comment. > Blocks aren't the same as braces Yeah, good point. I guess I was just seeing the brace in the block, but that's the wrong way to think about it. http://reviews.llvm.org/D17700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits