Before:
var aaaaa: List<SomeThing> = [
new SomeThingAAAAAAAAAAAA(),
new SomeThingBBBBBBBBB()
];
After:
var aaaaa: List<SomeThing> =
[new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];
llvm-svn: 238909
// Slightly prefer formatting local lambda definitions like functions.
if (Right.is(TT_LambdaLSquare) && Left.is(tok::equal))
return 50;
- if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare))
+ if (!Right.isOneOf(TT_ObjCMethodExpr, TT_LambdaLSquare,
+ TT_ArrayInitializerLSquare))
return 500;
}
}
TEST_F(FormatTestJS, ArrayLiterals) {
- verifyFormat("var aaaaa: List<SomeThing> = [\n"
- " new SomeThingAAAAAAAAAAAA(),\n"
- " new SomeThingBBBBBBBBB()\n"
- "];");
+ verifyFormat(
+ "var aaaaa: List<SomeThing> =\n"
+ " [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];");
verifyFormat("return [\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbb,\n"