Formatting index calls
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user