clang-format: Fix option formatting in protocol buffer files.
Before: optional int32 foo[ default = true, deprecated = true ]; After: optional int32 foo[default = true, deprecated = true]; llvm-svn: 200327
This commit is contained in:
parent
5fdb09bb76
commit
a0e9be2bb2
|
@ -248,6 +248,7 @@ private:
|
|||
if (CurrentToken->is(tok::colon))
|
||||
ColonFound = true;
|
||||
if (CurrentToken->is(tok::comma) &&
|
||||
Style.Language != FormatStyle::LK_Proto &&
|
||||
(Left->Type == TT_ArraySubscriptLSquare ||
|
||||
(Left->Type == TT_ObjCMethodExpr && !ColonFound)))
|
||||
Left->Type = TT_ArrayInitializerLSquare;
|
||||
|
|
|
@ -74,6 +74,10 @@ TEST_F(FormatTestProto, UnderstandsReturns) {
|
|||
|
||||
TEST_F(FormatTestProto, MessageFieldAttributes) {
|
||||
verifyFormat("optional string test = 1 [default = \"test\"];");
|
||||
verifyFormat("optional bool a = 1 [default = true, deprecated = true];");
|
||||
verifyFormat("optional LongMessageType long_proto_field = 1\n"
|
||||
" [default = REALLY_REALLY_LONG_CONSTANT_VALUE,\n"
|
||||
" deprecated = true];");
|
||||
verifyFormat("optional LongMessageType long_proto_field = 1\n"
|
||||
" [default = REALLY_REALLY_LONG_CONSTANT_VALUE];");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue