clang-format: Improve linebreaking and indentation for ObjC calls.
Before:
popup_wdow_.reset([[RenderWidgetPopupWindow alloc]
iniithContentRect:
NSMakRet(origin_global.x, origin_global.y, pos.width(), pos.height())
syeMask:NSBorderlessWindowMask
bking:NSBackingStoreBuffered
der:NO]);
[self param:function( //
parameter)]
After:
popup_wdow_.reset([[RenderWidgetPopupWindow alloc]
iniithContentRect:NSMakRet(origin_global.x, origin_global.y, pos.width(),
pos.height())
syeMask:NSBorderlessWindowMask
bking:NSBackingStoreBuffered
der:NO]);
[self param:function( //
parameter)]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194267 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 776bf49..7e4131b 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -5432,6 +5432,16 @@
" backing:NSBackingStoreBuffered\n"
" defer:NO]);\n"
"}");
+ verifyFormat(
+ "void f() {\n"
+ " popup_wdow_.reset([[RenderWidgetPopupWindow alloc]\n"
+ " iniithContentRect:NSMakRet(origin_global.x, origin_global.y,\n"
+ " pos.width(), pos.height())\n"
+ " syeMask:NSBorderlessWindowMask\n"
+ " bking:NSBackingStoreBuffered\n"
+ " der:NO]);\n"
+ "}",
+ getLLVMStyleWithColumns(70));
verifyFormat("[contentsContainer replaceSubview:[subviews objectAtIndex:0]\n"
" with:contentsNativeView];");
@@ -5462,6 +5472,8 @@
" aaaaaaaaaa:bbbbbbbbbbbbbbbbb\n"
" aaaaa:bbbbbbbbbbb + bbbbbbbbbbbb\n"
" aaaa:bbb];");
+ verifyFormat("[self param:function( //\n"
+ " parameter)]");
verifyFormat(
"[self aaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |\n"
" aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |\n"