Summary:
This fixes the detection of scope openers in text proto extensions; previously
they were not detected correctly leading to instances like:
```
msg {
[aa.bb
] {
key: value
}
}
```
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43469
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325513
91177308-0d34-0410-b5e6-
96231b3b80d8
if (is(TT_TemplateString) && opensScope())
return true;
return is(TT_ArrayInitializerLSquare) ||
+ is(TT_ProtoExtensionLSquare) ||
(is(tok::l_brace) &&
(BlockKind == BK_Block || is(TT_DictLiteral) ||
(!Style.Cpp11BracedListStyle && NestingLevel == 0))) ||
" keyyyyyyyyyyyyyy: valuuuuuuuuuuuuuuuuuuuuuuuuue\n"
" }\n"
"}");
+ verifyFormat(
+ "aaaaaaaaaaaaaaa {\n"
+ " bbbbbb {\n"
+ " [a.b/cy] {\n"
+ " eeeeeeeeeeeee: \"The lazy coo cat jumps over the lazy hot dog\"\n"
+ " }\n"
+ " }\n"
+ "}");
}
TEST_F(FormatTestTextProto, NoSpaceAfterPercent) {