[cfe-dev] clang-format behavior for Obj-C methods with block parameters

Daniel Jasper via cfe-dev cfe-dev at lists.llvm.org
Sun Dec 13 06:42:29 PST 2015


Nope, this behavior isn't currently implemented. I agree that it might make
sense, as it is similar to how clang-format treats lambdas at the end of
several other parameters.

On Fri, Dec 11, 2015 at 4:08 PM, Yavuz Nuzumlalı <cfe-dev at lists.llvm.org>
wrote:

> Hi everyone,
>
> I'm experiencing a problem with clang-format for my code.
>
> I'm using *ColumnLimit* as *120*. When I write some code like this:
>
> *[self testMethod:15 withBlock:^{*
> * NSLog(@"asdfasdf");*
> * NSLog(@"asdfasdf");*
> * NSLog(@"asdfasdf");*
> * NSLog(@"asdfasdf");*
> *}]**;*
>
> This code would be converted to this by clang-format:
>
> *[self testMethod:15*
> *       withBlock:^{*
> *       NSLog(@"asdfasdf");*
> *       NSLog(@"asdfasdf");*
> *       NSLog(@"asdfasdf");*
> *       NSLog(@"asdfasdf");*
> *   }];*
>
> That seems wrong to me because the method call before block variable
> actually fits in width of 120. I guess this is because clang-format behaves
> above code as a single method call and assumes it as one line. But I really
> want to not split the method like this because it feels weird.
>
> Is there a way to accomplish this with current system?
>
> I put my configuration file as an attachment.
>
> Best
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151213/0cb247bd/attachment-0001.html>


More information about the cfe-dev mailing list