| 40 columns | |
| >>> Don't split null-asserted chained calls if not needed. |
| compiler!.a().b()!.c.d(); |
| <<< |
| compiler!.a().b()!.c.d(); |
| >>> Keep `!` with operand before method call. |
| verylongIdentifier!.longIdentifier().another()!.aThird()!; |
| <<< |
| verylongIdentifier! |
| .longIdentifier() |
| .another()! |
| .aThird()!; |
| >>> Keep `!` with operand before property access. |
| verylongIdentifier!.longIdentifier.another!.aThird!; |
| <<< |
| verylongIdentifier! |
| .longIdentifier |
| .another! |
| .aThird!; |
| >>> Keep `!` with operand before property access. |
| verylongIdentifier!.longIdentifier.another!.aThird!.longerPropertyChain; |
| <<< |
| verylongIdentifier! |
| .longIdentifier |
| .another! |
| .aThird! |
| .longerPropertyChain; |
| >>> Index in property chain. |
| someReceiverObject.property1.property2 |
| .property3[0] |
| .property4 |
| .property5 |
| .property6; |
| <<< |
| someReceiverObject |
| .property1 |
| .property2 |
| .property3[0] |
| .property4 |
| .property5 |
| .property6; |
| >>> Chained indexes. |
| someReceiverObject.property1.property2 |
| .property3[argument] |
| [argument][argument] |
| .property4 |
| .property5 |
| .property6; |
| <<< |
| someReceiverObject |
| .property1 |
| .property2 |
| .property3[argument][argument][argument] |
| .property4 |
| .property5 |
| .property6; |
| >>> Index on method call. |
| someReceiverObject.property1.property2 |
| .method3()[0] |
| .property4 |
| .property5 |
| .property6; |
| <<< |
| someReceiverObject.property1.property2 |
| .method3()[0] |
| .property4 |
| .property5 |
| .property6; |
| >>> Split inside index. |
| someReceiverObject.method1().method2()[veryLongIndexExpression + thatHasInternalSplit] |
| .method4(); |
| <<< |
| someReceiverObject |
| .method1() |
| .method2()[veryLongIndexExpression + |
| thatHasInternalSplit] |
| .method4(); |
| >>> Null-aware index. |
| receiver.property1.property2 |
| .property3?[0][1]?[2] |
| .method1()?[0][1]?[2] |
| .method2(); |
| <<< |
| receiver |
| .property1 |
| .property2 |
| .property3?[0][1]?[2] |
| .method1()?[0][1]?[2] |
| .method2(); |
| >>> Function invocation in chain. |
| someReceiverObject.method1().method2().method3()(argument) |
| .method4()(another).method5().method6(); |
| <<< |
| someReceiverObject |
| .method1() |
| .method2() |
| .method3()(argument) |
| .method4()(another) |
| .method5() |
| .method6(); |
| >>> Split argument list in invocation. |
| someReceiverObject.method1().method2()(argument1, argument2, argument3) |
| .method4(); |
| <<< |
| someReceiverObject |
| .method1() |
| .method2()( |
| argument1, |
| argument2, |
| argument3, |
| ) |
| .method4(); |
| >>> Invocation with type arguments. |
| target.method()<int, String>(123, 'string').another(); |
| <<< |
| target |
| .method()<int, String>( |
| 123, |
| 'string', |
| ) |
| .another(); |
| >>> Chained invocations. |
| target.method1().method2()(1)(2, 3)(4, 5, 6).method3().method4(); |
| <<< |
| target |
| .method1() |
| .method2()(1)(2, 3)(4, 5, 6) |
| .method3() |
| .method4(); |
| >>> Chained complex invocations. |
| someReceiverObject.method1().method2().method3() |
| (argument)(argument)<T, R>(argument, argument, argument, argument, argument) |
| (argument).method4().method5().method6(); |
| <<< |
| someReceiverObject |
| .method1() |
| .method2() |
| .method3()(argument)( |
| argument, |
| )<T, R>( |
| argument, |
| argument, |
| argument, |
| argument, |
| argument, |
| )(argument) |
| .method4() |
| .method5() |
| .method6(); |
| >>> Keep `!` with operand before index. |
| verylongIdentifier![i]![j].longIdentifier[i][j].another[i]![j].aThird!; |
| <<< |
| verylongIdentifier![i]![j] |
| .longIdentifier[i][j] |
| .another[i]![j] |
| .aThird!; |
| >>> Keep `!` with operand before invocation. |
| verylongIdentifier!(i)!(j).longIdentifier(i)(j).another(i)!(j).aThird!; |
| <<< |
| verylongIdentifier!(i)!(j) |
| .longIdentifier(i)(j) |
| .another(i)!(j) |
| .aThird!; |
| >>> Mixed postfix operations. |
| target.method().another(); |
| <<< |
| target |
| .method() |
| .another(); |