Author: djasper Date: Fri Feb 3 02:29:02 2017 New Revision: 293995 URL: http://llvm.org/viewvc/llvm-project?rev=293995&view=rev Log: clang-format: [Proto] Also supports implicit string literal concatenation
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/Format/FormatTestProto.cpp Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=293995&r1=293994&r2=293995&view=diff ============================================================================== --- cfe/trunk/lib/Format/TokenAnnotator.cpp (original) +++ cfe/trunk/lib/Format/TokenAnnotator.cpp Fri Feb 3 02:29:02 2017 @@ -2391,7 +2391,8 @@ bool TokenAnnotator::mustBreakBefore(con 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; Modified: cfe/trunk/unittests/Format/FormatTestProto.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestProto.cpp?rev=293995&r1=293994&r2=293995&view=diff ============================================================================== --- cfe/trunk/unittests/Format/FormatTestProto.cpp (original) +++ cfe/trunk/unittests/Format/FormatTestProto.cpp Fri Feb 3 02:29:02 2017 @@ -135,6 +135,9 @@ TEST_F(FormatTestProto, MessageFieldAttr " key: 'a' //\n" " }\n" "];"); + verifyFormat("optional string test = 1 [default =\n" + " \"test\"\n" + " \"test\"];"); } TEST_F(FormatTestProto, DoesntWrapFileOptions) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits