<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks for the response Daniel,<div class=""><br class=""></div><div class="">Could you guide me on where can I look inside clang-format implementation to see how clang-format currently handles lambdas in other languages, so that I may try to implement the same functionality for Objective-C case? </div><div class=""><br class=""></div><div class="">Besides that, I have one more question, which is somewhat related to topic.</div><div class=""><br class=""></div><div class="">When I try to use clang-format to format the following simple code:<br class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">- (void)asdf {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">     </span>[UIView animateasdfasdf:0 animations:^{ }];</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">      </span>[UIView animations:^{ } done:YES];</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">       </span>[UIView animations:^{ } completion:^{ }];</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>[UIView testasdfasdfsd:YES animations:^{ } completion:^{ }];</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">     </span>[UIView animations:^{ } tessd:YES completion:^{ }];</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">Output is the following:<br class=""><br class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class="">- (void)asdf {</div><div style="margin: 0px; line-height: normal;" class="">  [UIView animateasdfasdf:0</div><div style="margin: 0px; line-height: normal;" class="">               animations:^{</div><div style="margin: 0px; line-height: normal;" class="">               }];</div><div style="margin: 0px; line-height: normal;" class="">  [UIView animations:^{</div><div style="margin: 0px; line-height: normal;" class="">  }</div><div style="margin: 0px; line-height: normal;" class="">                done:YES];</div><div style="margin: 0px; line-height: normal;" class="">  [UIView animations:^{</div><div style="margin: 0px; line-height: normal;" class="">  }</div><div style="margin: 0px; line-height: normal;" class="">      completion:^{</div><div style="margin: 0px; line-height: normal;" class="">      }];</div><div style="margin: 0px; line-height: normal;" class="">  [UIView testasdfasdfsd:YES</div><div style="margin: 0px; line-height: normal;" class="">      animations:^{</div><div style="margin: 0px; line-height: normal;" class="">      }</div><div style="margin: 0px; line-height: normal;" class="">      completion:^{</div><div style="margin: 0px; line-height: normal;" class="">      }];</div><div style="margin: 0px; line-height: normal;" class="">  [UIView animations:^{</div><div style="margin: 0px; line-height: normal;" class="">  }</div><div style="margin: 0px; line-height: normal;" class="">      tessd:YES</div><div style="margin: 0px; line-height: normal;" class="">      completion:^{</div><div style="margin: 0px; line-height: normal;" class="">      }];</div><div style="margin: 0px; line-height: normal;" class="">}</div></div><span class=""><div class=""><span class=""><br class=""></span></div></span></div><div class=""><span class="">I think clang-format somehow decides to not use colon alignment but align using `</span>ContinuationIndentWidth` where there are more than one block parameters.</div><div class=""><span class="">Is this an intended behavior? Seems like a bug to me.</span></div><div class=""><span class=""><br class=""><blockquote type="cite" class="">On 13 Dec 2015, at 16:42, Daniel Jasper <<a href="mailto:djasper@google.com" class="">djasper@google.com</a>> wrote:<br class=""><br class="">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.<br class=""><br class="">On Fri, Dec 11, 2015 at 4:08 PM, Yavuz Nuzumlalı <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">Hi everyone,<br class=""><br class="">I'm experiencing a problem with clang-format for my code.<br class=""><br class="">I'm using ColumnLimit as 120. When I write some code like this:<br class=""><br class="">[self testMethod:15 withBlock:^{<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>NSLog(@"asdfasdf");<br class="">}];<br class=""><br class="">This code would be converted to this by clang-format:<br class=""><br class="">[self testMethod:15<br class="">       withBlock:^{<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>       NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>       NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>       NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>       NSLog(@"asdfasdf");<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>   }];<br class=""><br class="">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.<br class=""><br class="">Is there a way to accomplish this with current system?<br class=""><br class="">I put my configuration file as an attachment.<br class=""><br class="">Best<br class=""><br class=""><br class="">_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""><br class=""><br class=""></blockquote><br class=""></span></div></body></html>