Format spaces in infix call (KT-12018)

#KT-12018 Fixed
This commit is contained in:
Kirill
2016-04-23 17:36:59 +02:00
committed by Nikolay Krasko
parent 01b754b318
commit 6e08f06bfd
9 changed files with 18 additions and 4 deletions
+1
View File
@@ -43,6 +43,7 @@ Issues fixed:
- [KT-10950](https://youtrack.jetbrains.com/issue/KT-10950) Keep original file package name when moving top-level declarations to separate file (provided it's not ambiguous)
- [KT-10174](https://youtrack.jetbrains.com/issue/KT-10174) Optimize imports after applying "Move declaration to separate file" intention
- [KT-12035](https://youtrack.jetbrains.com/issue/KT-12035) Auto-format cast expressions
- [KT-12018](https://youtrack.jetbrains.com/issue/KT-12018) Auto-format spaces between function name and arguments in infix calls
#### Debugger
@@ -165,6 +165,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
afterInside(IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
around(AS_KEYWORD).spaces(1)
aroundInside(IDENTIFIER, BINARY_EXPRESSION).spaces(1)
// before LPAR in constructor(): this() {}
after(CONSTRUCTOR_DELEGATION_REFERENCE).spacing(0, 0, 0, false, 0)
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
val a = 1 shl 2
}
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
val a = 1 shl 2
}
@@ -12,5 +12,5 @@ class Y(val y: Int) {
}
private fun __dummyTestFun__(x1: X, y1: Y) {
x1.`x`plus y1.y
x1.`x` plus y1.y
}
@@ -6,5 +6,5 @@ fun test() {
}
private fun __dummyTestFun__(`i`: Int) {
`i`plus i
`i` plus i
}
@@ -6,5 +6,5 @@ fun test() {
}
private fun __dummyTestFun__(`0`: Int) {
`0`plus 1
`0` plus 1
}
@@ -6,5 +6,5 @@ fun test() {
}
private fun __dummyTestFun__(i: Int) {
`i`plus i
`i` plus i
}
@@ -343,6 +343,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
doTest(fileName);
}
@TestMetadata("InfixCall.after.kt")
public void testInfixCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/InfixCall.after.kt");
doTest(fileName);
}
@TestMetadata("KDoc.after.kt")
public void testKDoc() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/KDoc.after.kt");