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
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
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
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
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/
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
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