Fix KT-16725; Remove spaces between array indices

This commit is contained in:
Andrius Semionovas
2017-05-31 16:15:15 +03:00
committed by Dmitry Jemerov
parent 46ce9a6946
commit 4acb95acb5
6 changed files with 15 additions and 3 deletions
@@ -257,6 +257,8 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
around(BY_KEYWORD).spaces(1) around(BY_KEYWORD).spaces(1)
betweenInside(IDENTIFIER, PROPERTY_DELEGATE, PROPERTY).spaces(1) betweenInside(IDENTIFIER, PROPERTY_DELEGATE, PROPERTY).spaces(1)
before(INDICES).spaces(0)
} }
custom { custom {
+2
View File
@@ -0,0 +1,2 @@
val array = emptyArray<Any>()
val foo = array[0]
+2
View File
@@ -0,0 +1,2 @@
val array = emptyArray<Any>()
val foo = array [0]
@@ -596,6 +596,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
doTest(fileName); doTest(fileName);
} }
@TestMetadata("SpaceBeforeIndices.after.kt")
public void testSpaceBeforeIndices() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/SpaceBeforeIndices.after.kt");
doTest(fileName);
}
@TestMetadata("SpacedInsideParans.after.kt") @TestMetadata("SpacedInsideParans.after.kt")
public void testSpacedInsideParans() throws Exception { public void testSpacedInsideParans() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/SpacedInsideParans.after.kt"); String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/SpacedInsideParans.after.kt");