From: Ben Hamilton Date: Thu, 14 Dec 2017 21:44:11 +0000 (+0000) Subject: Revert "[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d32e8534a612dedd328b5c4546123211c97ee265;p=clang Revert "[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style" This reverts commit 37e69667f748e1458b46483b7c1b8f9ba33eec44. We're going to discuss its ramifications further before making a conclusion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320747 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 5ddc164459..217c6729ee 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -732,7 +732,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { GoogleStyle.SpacesInContainerLiterals = false; } else if (Language == FormatStyle::LK_ObjC) { GoogleStyle.ColumnLimit = 100; - GoogleStyle.IndentWrappedFunctionNames = true; } return GoogleStyle; diff --git a/unittests/Format/FormatTestObjC.cpp b/unittests/Format/FormatTestObjC.cpp index 292466c0aa..4220b44b4c 100644 --- a/unittests/Format/FormatTestObjC.cpp +++ b/unittests/Format/FormatTestObjC.cpp @@ -382,9 +382,9 @@ TEST_F(FormatTestObjC, FormatObjCMethodDeclarations) { " ofSize:(size_t)height\n" " :(size_t)width;"); - Style = getGoogleStyle(FormatStyle::LK_ObjC); // Continuation indent width should win over aligning colons if the function // name is long. + Style = getGoogleStyle(FormatStyle::LK_ObjC); Style.ColumnLimit = 40; Style.IndentWrappedFunctionNames = true; verifyFormat("- (void)shortf:(GTMFoo *)theFoo\n" @@ -395,10 +395,7 @@ TEST_F(FormatTestObjC, FormatObjCMethodDeclarations) { verifyFormat("- (void)shortf:(GTMFoo *)theFoo\n" " aShortf:(NSRect)theRect {\n" "}"); - // Wrapped method parameters should be indented. - verifyFormat("- (LongReturnTypeName)\n" - " longParam:(ParamName)longParamName\n" - " param:(paramName)paramName;"); + // Format pairs correctly. Style.ColumnLimit = 80; verifyFormat("- (void)drawRectOn:(id)surface\n"