Formatter: fix line break between declarations with comment

#KT-12490 Fixed
#KT-35088 Fixed
This commit is contained in:
Dmitry Gridin
2019-11-15 21:57:37 +07:00
parent b6b755506c
commit bfd539d5d1
49 changed files with 191 additions and 12 deletions
+1
View File
@@ -14,6 +14,7 @@ internal class A {
private /*it's private*/ val field = 0
/*it's public*/ fun foo(s: String?): Char {}
protected /*it's protected*/ fun foo(c: Char) {}
/**
* Method description.
* Multi-line method description.
+1
View File
@@ -8,6 +8,7 @@ internal class A(// comment for field2 setter
// Comment for field1 getter
// Comment for field1
var field1 = 0
// comment for field3 setter
// comment for field3 getter
// comment before field3
@@ -5,6 +5,7 @@ internal class A {
var field1 = 0
@Transient
var field2 = 1
// Should work even for bad modifiers
@Strictfp
var field3 = 2.0
@@ -6,7 +6,6 @@ internal class F {
//c3
//c4
fun f2() {}
var i = 0
fun f3() {} //c5
}
@@ -2,7 +2,6 @@ internal class F {
//c3
//c4
fun f2() {}
fun f3() {}
fun f4() {}
@@ -10,8 +9,8 @@ internal class F {
//c1
/*c2*/
fun f1() {}
var i = 0
//c5
fun f5() {} //c6
}
@@ -6,7 +6,6 @@ internal object F {
//c3
//c4
fun f2() {}
var i = 0
fun f3() {} //c5
}
+1
View File
@@ -49,6 +49,7 @@ internal class C {
*/
//comments
var l = 0
/*two*/ /*comments*/ /*line*/
var z = 0
}