Skip to content
Snippets Groups Projects
Commit cdbc68e5 authored by Daniel Jasper's avatar Daniel Jasper
Browse files

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}];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207538 91177308-0d34-0410-b5e6-96231b3b80d8
parent 8cf5dd69
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment