clang-format: [Proto] Also supports implicit string literal concatenation

llvm-svn: 293995
This commit is contained in:
Daniel Jasper 2017-02-03 08:29:02 +00:00
parent a16cfe6fa9
commit da910e0a8b
2 changed files with 5 additions and 1 deletions

View File

@ -2391,7 +2391,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
Right.Next->is(tok::string_literal))
return true;
} else if (Style.Language == FormatStyle::LK_Cpp ||
Style.Language == FormatStyle::LK_ObjC) {
Style.Language == FormatStyle::LK_ObjC ||
Style.Language == FormatStyle::LK_Proto) {
if (Left.isStringLiteral() &&
(Right.isStringLiteral() || Right.is(TT_ObjCStringLiteral)))
return true;

View File

@ -135,6 +135,9 @@ TEST_F(FormatTestProto, MessageFieldAttributes) {
" key: 'a' //\n"
" }\n"
"];");
verifyFormat("optional string test = 1 [default =\n"
" \"test\"\n"
" \"test\"];");
}
TEST_F(FormatTestProto, DoesntWrapFileOptions) {