diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java b/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java index 799df496b4c..9cc38e0133d 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java +++ b/idea/src/org/jetbrains/jet/plugin/formatter/JetBlock.java @@ -321,6 +321,10 @@ public class JetBlock extends AbstractBlock { .in(DELEGATION_SPECIFIER_LIST) .set(Indent.getContinuationIndent(false)), + ASTIndentStrategy.forNode("Indices") + .in(INDICES) + .set(Indent.getContinuationIndent(false)), + ASTIndentStrategy.forNode("Binary expressions") .in(BINARY_EXPRESSION) .set(Indent.getContinuationWithoutFirstIndent(false)), diff --git a/idea/testData/formatter/ArrayAccess.after.kt b/idea/testData/formatter/ArrayAccess.after.kt new file mode 100644 index 00000000000..a0bb195d191 --- /dev/null +++ b/idea/testData/formatter/ArrayAccess.after.kt @@ -0,0 +1,24 @@ +fun test() { + a[1] + + a[1, 2] + a[1, 2] + + a[ + 1, 2 + ] + + a [ + + 1, 2 + + ] + + a [ + + + 1, 2 + + + ] +} \ No newline at end of file diff --git a/idea/testData/formatter/ArrayAccess.kt b/idea/testData/formatter/ArrayAccess.kt new file mode 100644 index 00000000000..fcf724722a1 --- /dev/null +++ b/idea/testData/formatter/ArrayAccess.kt @@ -0,0 +1,27 @@ +fun test() { + a[ 1 ] + + a[1, 2] + a[ 1, 2 ] + + a[ + 1, 2 + ] + + a [ + + 1, 2 + + ] + + a [ + + + + 1, 2 + + + + + ] +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java index 43633407da3..e2644f7c64b 100644 --- a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java @@ -39,6 +39,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true); } + @TestMetadata("ArrayAccess.after.kt") + public void testArrayAccess() throws Exception { + doTest("idea/testData/formatter/ArrayAccess.after.kt"); + } + @TestMetadata("BinaryExpressions.after.kt") public void testBinaryExpressions() throws Exception { doTest("idea/testData/formatter/BinaryExpressions.after.kt");