J2K: do not drop formatting for expressions with operator

This commit is contained in:
Natalia Ukhorskaya
2015-11-11 18:05:00 +03:00
parent 293b8eeda8
commit 68101eeffa
16 changed files with 180 additions and 72 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ internal enum class Color : Runnable {
WHITE, BLACK, RED, YELLOW, BLUE;
override fun run() {
println("name()=" + name + ", toString()=" + toString())
println("name()=" + name +
", toString()=" + toString())
}
}
@@ -1,6 +1,7 @@
//file
import kotlinApi.*;
//TODO: Formatter works incorrectly
class A {
int foo(KotlinClass c) {
return c.getNullableProperty().length()
@@ -1,7 +1,15 @@
import kotlinApi.*
//TODO: Formatter works incorrectly
internal class A {
fun foo(c: KotlinClass): Int {
return c.nullableProperty!!.length + c.property.length + KotlinClass.nullableStaticVar!! + KotlinClass.staticVar + KotlinClass.nullableStaticFun(1)!! + KotlinClass.staticFun(1) + nullableGlobalFunction("")!!.length + globalFunction("").length
return c.nullableProperty!!.length
+c.property.length
+KotlinClass.nullableStaticVar!!
+KotlinClass.staticVar
+KotlinClass.nullableStaticFun(1)!!
+KotlinClass.staticFun(1)
+nullableGlobalFunction("")!!.length
+globalFunction("").length
}
}
@@ -4,6 +4,8 @@ internal class C {
fun foo(): Int {
KotlinObject.property1 = 1
KotlinObject.property2 = 2
return KotlinObject.foo() + KotlinObject.property1 + KotlinObject.property2
return KotlinObject.foo() +
KotlinObject.property1 +
KotlinObject.property2
}
}
+10
View File
@@ -0,0 +1,10 @@
public class A {
public static final String TEXT1 = "text1.\n" +
"text2\n" +
"text3";
public static final String TEXT2 = "text1\n"
+ "text2\n"
+ "text3";
}
+10
View File
@@ -0,0 +1,10 @@
object A {
val TEXT1 = "text1.\n" +
"text2\n" +
"text3"
val TEXT2 = "text1\n"
+ "text2\n"
+ "text3"
}