[PATCH] D41195: [ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style
Ben Hamilton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 14 08:18:27 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rC320714: [ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style (authored by benhamilton, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41195?vs=126969&id=126970#toc
Repository:
rC Clang
https://reviews.llvm.org/D41195
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestObjC.cpp
Index: lib/Format/Format.cpp
===================================================================
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -732,6 +732,7 @@
GoogleStyle.SpacesInContainerLiterals = false;
} else if (Language == FormatStyle::LK_ObjC) {
GoogleStyle.ColumnLimit = 100;
+ GoogleStyle.IndentWrappedFunctionNames = true;
}
return GoogleStyle;
Index: unittests/Format/FormatTestObjC.cpp
===================================================================
--- unittests/Format/FormatTestObjC.cpp
+++ unittests/Format/FormatTestObjC.cpp
@@ -382,9 +382,9 @@
" 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,7 +395,10 @@
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"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41195.126970.patch
Type: text/x-patch
Size: 1499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171214/a1a64580/attachment.bin>
More information about the cfe-commits
mailing list