This revision was automatically updated to reflect the committed changes. Closed by commit rL326945: [clang-format] Break consecutive string literals in text protos (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits.
Repository: rL LLVM https://reviews.llvm.org/D44204 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/Format/FormatTestTextProto.cpp Index: cfe/trunk/lib/Format/TokenAnnotator.cpp =================================================================== --- cfe/trunk/lib/Format/TokenAnnotator.cpp +++ cfe/trunk/lib/Format/TokenAnnotator.cpp @@ -2717,7 +2717,8 @@ return true; } else if (Style.Language == FormatStyle::LK_Cpp || Style.Language == FormatStyle::LK_ObjC || - Style.Language == FormatStyle::LK_Proto) { + Style.Language == FormatStyle::LK_Proto || + Style.Language == FormatStyle::LK_TextProto) { if (Left.isStringLiteral() && Right.isStringLiteral()) return true; } Index: cfe/trunk/unittests/Format/FormatTestTextProto.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestTextProto.cpp +++ cfe/trunk/unittests/Format/FormatTestTextProto.cpp @@ -452,5 +452,11 @@ " >\n" ">"); } + +TEST_F(FormatTestTextProto, BreaksConsecutiveStringLiterals) { + verifyFormat("ala: \"str1\"\n" + " \"str2\"\n"); +} + } // end namespace tooling } // end namespace clang
Index: cfe/trunk/lib/Format/TokenAnnotator.cpp =================================================================== --- cfe/trunk/lib/Format/TokenAnnotator.cpp +++ cfe/trunk/lib/Format/TokenAnnotator.cpp @@ -2717,7 +2717,8 @@ return true; } else if (Style.Language == FormatStyle::LK_Cpp || Style.Language == FormatStyle::LK_ObjC || - Style.Language == FormatStyle::LK_Proto) { + Style.Language == FormatStyle::LK_Proto || + Style.Language == FormatStyle::LK_TextProto) { if (Left.isStringLiteral() && Right.isStringLiteral()) return true; } Index: cfe/trunk/unittests/Format/FormatTestTextProto.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestTextProto.cpp +++ cfe/trunk/unittests/Format/FormatTestTextProto.cpp @@ -452,5 +452,11 @@ " >\n" ">"); } + +TEST_F(FormatTestTextProto, BreaksConsecutiveStringLiterals) { + verifyFormat("ala: \"str1\"\n" + " \"str2\"\n"); +} + } // end namespace tooling } // end namespace clang
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits