clang-format: Don't bin-pack text-proto-formatted options.

Before:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,
                              bbbbbbb: BBBB, bbbb: BBB}];

After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,
                              bbbbbbb: BBBB,
                              bbbb: BBB}];

llvm-svn: 207538
This commit is contained in:
Daniel Jasper 2014-04-29 15:54:14 +00:00
parent 0f250ed55f
commit 883ae9d9a3
2 changed files with 5 additions and 0 deletions

View File

@ -725,6 +725,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
AvoidBinPacking = Current.BlockKind == BK_Block ||
Current.Type == TT_ArrayInitializerLSquare ||
Current.Type == TT_DictLiteral ||
Style.Language == FormatStyle::LK_Proto ||
!Style.BinPackParameters ||
(NextNoComment &&
NextNoComment->Type == TT_DesignatedInitializerPeriod);

View File

@ -88,6 +88,10 @@ TEST_F(FormatTestProto, MessageFieldAttributes) {
verifyFormat("repeated double value = 1\n"
" [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA\n"
" bbbbbbbbbbbbbbbb: BBBBBBBBBB}];");
verifyFormat("repeated double value = 1\n"
" [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
" bbbbbbb: BBBB,\n"
" bbbb: BBB}];");
}
TEST_F(FormatTestProto, FormatsOptions) {