Previous.Type != TT_InlineASMColon &&
Previous.Type != TT_ConditionalExpr && nextIsMultilineString(State))
return true;
- if (Style.Language != FormatStyle::LK_Proto &&
- ((Previous.Type == TT_DictLiteral && Previous.is(tok::l_brace)) ||
+ if (((Previous.Type == TT_DictLiteral && Previous.is(tok::l_brace)) ||
Previous.Type == TT_ArrayInitializerLSquare) &&
Style.ColumnLimit > 0 &&
getLengthToMatchingParen(Previous) + State.Column > getColumnLimit(State))
return Right.NewlinesBefore > 0;
} else if (Right.Previous->is(tok::l_brace) && Right.NestingLevel == 1 &&
Style.Language == FormatStyle::LK_Proto) {
- // Don't enums onto single lines in protocol buffers.
+ // Don't put enums onto single lines in protocol buffers.
return true;
} else if (Style.Language == FormatStyle::LK_JavaScript &&
Right.is(tok::r_brace) && Left.is(tok::l_brace) &&
" [default = REALLY_REALLY_LONG_CONSTANT_VALUE];");
verifyFormat("repeated double value = 1\n"
" [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaa: AAAAAAAA}];");
- verifyFormat("repeated double value = 1\n"
- " [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
- " bbbbbbbbbbbbbbbb: BBBBBBBBBB}];");
- 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}];");
+ verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
+ " aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
+ " bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
+ "}];");
+ verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
+ " aaaaaaaaaaaaaaaa: AAAAAAAAAA\n"
+ " bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
+ "}];");
+ verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
+ " aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
+ " bbbbbbb: BBBB,\n"
+ " bbbb: BBB\n"
+ "}];");
}
TEST_F(FormatTestProto, FormatsOptions) {
" field_a: OK\n"
" field_b: \"OK\"\n"
" field_c: \"OK\"\n"
- " msg_field: {field_d: 123\n"
- " field_e: OK}\n"
+ " msg_field: {\n"
+ " field_d: 123\n"
+ " field_e: OK\n"
+ " }\n"
"};");
verifyFormat("option (MyProto.options) = {\n"