yixiang added a reviewer: djasper.
yixiang added a subscriber: cfe-commits.
yixiang updated this revision to Diff 80174.
https://reviews.llvm.org/D27382
Files:
docs/ClangFormatStyleOptions.rst
include/clang/Format/Format.h
lib/Format/ContinuationIndenter.cpp
lib/Format/Format.cpp
Index:
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
yixiang abandoned this revision.
yixiang added a comment.
Sending as another diff using arcanist. This one doesn't have proper file
context for reviewing.
https://reviews.llvm.org/D27382
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http:
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/
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 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.
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 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