From 2537e2209454a67f9630fcacae6b05e2a7caffb1 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Wed, 17 Jan 2018 16:17:26 +0000 Subject: [clang-format] adds enclosing function detection to raw string formatting Summary: This patch adds enclosing function detection to raw string formatting. Reviewers: bkramer Reviewed By: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42167 llvm-svn: 322678 --- clang/lib/Format/Format.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/Format/Format.cpp') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index ebcf3ab4539..6ef38ad1692 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -457,6 +457,7 @@ template <> struct MappingTraits { static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) { IO.mapOptional("Language", Format.Language); IO.mapOptional("Delimiters", Format.Delimiters); + IO.mapOptional("EnclosingFunctions", Format.EnclosingFunctions); IO.mapOptional("BasedOnStyle", Format.BasedOnStyle); } }; @@ -705,6 +706,12 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { "textproto", "TEXTPROTO", }, + /*EnclosingFunctionNames=*/ + { + "EqualsProto", + "PARSE_TEXT_PROTO", + "ParseTextProto", + }, /*BasedOnStyle=*/"google", }}; GoogleStyle.SpacesBeforeTrailingComments = 2; -- cgit v1.2.3