<div dir="ltr">Will do! Also, looks like I was a bit pessimistic about the behavior and optimistic about my fix. It looks like the block formatting does work when a column width is set, and not when it's set to 0, like we have. Also, my fix is breaking the ability to have 1 line blocks. I thought I had ran the unit tests, but once you pointed me to that, I realized I missed them. I'll look into it more as I have time and get a new patch in.<div><br></div><div>Thanks for the feedback tho!</div><div><br></div><div>Brian</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 5, 2015 at 1:44 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Brian,<div><br></div><div>thanks for working on this. Could you provide an example or two of what behavior is changing exactly? Also add tests in unittests/Format/FormatTest.cpp. There are certainly tests there that test multiline behavior and it should be obvious how to add additional ones. Somewhat next to other ObjC tests would probably be good, e.g. close to "TEST_F(FormatTest, FormatsBlocks) {".</div><div><br></div><div>Also, generally prefer using our code review system on <a href="http://reviews.llvm.org" target="_blank">http://reviews.llvm.org</a>.</div><div><br></div><div>Cheers,</div><div>Daniel</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Apr 5, 2015 at 6:56 PM, Brian King <span dir="ltr"><<a href="mailto:brianaking@gmail.com" target="_blank">brianaking@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">The current version of clang-format does not apply formatting rules inside of c blocks. This significantly reduces the usefulness of clang-format in Obj-C projects.<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>When I turned on debug, I noticed that all the lines were being added as child-lines in the UnwrappedLineParser, which apparently causes Format to not suggest replacements.<br></div><div><br></div><div>parseStructuralElement had some code to parse C Blocks and handed them off to parseChildBlock. I changed that to use parseLevel  so that the blocks would be handled like other types of blocks. I found 3 different places that blocks can be encountered, a variable declaration(parseStructuralElement), an objective-c invocation(parseSquare), and a C method invocation(parseParens). This patch should pass the tokens through a new method parseCBlock when a carat is encountered in those methods.</div><div><br></div><div>All of the tests continue to pass. I did not see any clang-format tests that tested any multi-line behavior and it wasn't too clear how to add them. I did run this on a lot of different styles of block behavior, and it works as expected.</div><div><br></div><div>Thanks for the awesome project, if there's anything I can do to help this get accepted, I'll gladly keep working on it.</div><span><font color="#888888"><span><font color="#888888"><div><br></div><div><br></div><div>Brian King</div><div><br></div></font></span></font></span></div>
</div><br></div>
<br></div></div>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>