[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-12 Thread Sean Lu via Phabricator via cfe-commits
yixiang added a comment. Ping. For the additional requirements of adding a style options: - be used in a project of significant size (have dozens of contributors) - Yes, it's been used by almost all the iOS projects inside Google, including Google Maps. - have a publicly accessible style guid

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-05 Thread Sean Lu via Phabricator via cfe-commits
yixiang added a comment. Discover a case where my code breaks. When the block signature has a return type in it, the indent doesn't gets reset properly. I need to fix this. // clang-format -style='{ObjCBlockResetsIndent: true}' test.m [self callAsyncMethodWithParam:2 withCompletio

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-03 Thread Sean Lu via Phabricator via cfe-commits
yixiang updated this revision to Diff 80192. yixiang added a comment. - Don't reset indent for statements with multiple blocks. https://reviews.llvm.org/D27383 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-03 Thread Sean Lu via Phabricator via cfe-commits
yixiang added a comment. > Can you add tests in unittests/Format/FormatTest.cpp (probably next to > TEST_F(FormatTest, FormatsBlocks) {..})? > What's the behavior when there is more than one block? Unit tests added. > Also note that we have some requirements for additional options (mainly to

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-03 Thread Sean Lu via Phabricator via cfe-commits
yixiang updated this revision to Diff 80176. yixiang added a comment. - Added unit test for ObjCBlockResetsIndent. https://reviews.llvm.org/D27383 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp unittests/

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-03 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I think generally, this makes sense. Can you add tests in unittests/Format/FormatTest.cpp (probably next to TEST_F(FormatTest, FormatsBlocks) {..})? What's the behavior when there is more than one block? Also note that we have some requirements for additional options (m

[PATCH] D27383: Add a new clang-format style option ObjCBlockResetsIndent.

2016-12-03 Thread Sean Lu via Phabricator via cfe-commits
yixiang created this revision. yixiang added a reviewer: djasper. yixiang added subscribers: cfe-commits, klimek. Add a new clang-format style option ObjCBlockResetsIndent of type bool. It defaults to false. When true, ObjC blocks resets indentation to that of its owner block. The resetting behav