diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 2785ca45e70f..16115611a5da 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -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; diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index 6881af4361cf..41d210ac7cd7 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -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) {