Format spaces in infix call (KT-12018)
#KT-12018 Fixed
This commit is contained in:
@@ -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
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val a = 1 shl 2
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val a = 1 shl 2
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
+1
-1
@@ -6,5 +6,5 @@ fun test() {
|
||||
}
|
||||
|
||||
private fun __dummyTestFun__(`i`: Int) {
|
||||
`i`plus i
|
||||
`i` plus i
|
||||
}
|
||||
+1
-1
@@ -6,5 +6,5 @@ fun test() {
|
||||
}
|
||||
|
||||
private fun __dummyTestFun__(`0`: Int) {
|
||||
`0`plus 1
|
||||
`0` plus 1
|
||||
}
|
||||
+1
-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");
|
||||
|
||||
Reference in New Issue
Block a user