Formatting index calls

This commit is contained in:
Nikolay Krasko
2014-04-25 21:48:38 +04:00
parent cd3aa06a83
commit 2a693bcada
4 changed files with 60 additions and 0 deletions
@@ -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)),
@@ -0,0 +1,24 @@
fun test() {
a[1]
a[1, 2]
a[1, 2]
a[
1, 2
]
a [
1, 2
]
a [
1, 2
]
}
+27
View File
@@ -0,0 +1,27 @@
fun test() {
a[ 1 ]
a[1, 2]
a[ 1, 2 ]
a[
1, 2
]
a [
1, 2
]
a [
1, 2
]
}
@@ -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");