Insert empty lines after functions and properties (KT-4002)

#KT-4002 Fixed
This commit is contained in:
Nikolay Krasko
2014-10-10 17:50:37 +04:00
parent 22d33a5afa
commit b06b3ab4c4
54 changed files with 764 additions and 121 deletions
@@ -8,15 +8,19 @@ class C : Base<String, C, Unit>() {
override fun bar(value: () -> Unit): (String) -> Unit {
<selection><caret>return super<Base>.bar(value)</selection>
}
override fun equals(other: Any?): Boolean {
return super<Base>.equals(other)
}
override fun foo(value: C): C {
return super<Base>.foo(value)
}
override fun hashCode(): Int {
return super<Base>.hashCode()
}
override val method: (String?) -> String = ?
override fun toString(): String {
return super<Base>.toString()
@@ -7,15 +7,19 @@ class C(t :T) : T by t {
override fun bar() {
<selection><caret>throw UnsupportedOperationException()</selection>
}
override fun equals(other: Any?): Boolean {
return super<T>.equals(other)
}
override fun foo() {
throw UnsupportedOperationException()
}
override fun hashCode(): Int {
return super<T>.hashCode()
}
override fun toString(): String {
return super<T>.toString()
}
@@ -10,9 +10,11 @@ class SomeOther<S> : Some<S> {
override fun someFoo() {
<selection><caret>throw UnsupportedOperationException()</selection>
}
override fun someGenericFoo(): S {
throw UnsupportedOperationException()
}
override fun someOtherFoo(): Int {
throw UnsupportedOperationException()
}
@@ -14,20 +14,25 @@ class C : A(), B {
override fun equals(other: Any?): Boolean {
<selection><caret>return super<A>.equals(other)</selection>
}
override fun hashCode(): Int {
return super<A>.hashCode()
}
override fun internalFun() {
super<A>.internalFun()
}
override val internalProperty: Int = 0
override fun protectedFun() {
super<A>.protectedFun()
}
override val protectedProperty: Int = 0
override fun publicFun() {
super<A>.publicFun()
}
override val publicProperty: Int = 0
override fun toString(): String {
return super<A>.toString()
@@ -7,15 +7,19 @@ class C : A {
override fun bar(): String {
<selection><caret>return super<A>.bar()</selection>
}
override fun equals(other: Any?): Boolean {
return super<A>.equals(other)
}
override fun foo(value: String): Int {
return super<A>.foo(value)
}
override fun hashCode(): Int {
return super<A>.hashCode()
}
override fun toString(): String {
return super<A>.toString()
}
@@ -6,16 +6,20 @@ class Other {
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
}
fun test() {
val a = 1
}
fun otherTest() {
}
}
}
@@ -6,16 +6,21 @@ class Other {
fun test() {
val a = 1
}
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
}
fun otherTest() {
}
}
}
@@ -6,16 +6,20 @@ class Other {
override fun equals(other: Any?): Boolean {
<selection><caret>return super<Any>.equals(other)</selection>
}
override fun hashCode(): Int {
return super<Any>.hashCode()
}
override fun toString(): String {
return super<Any>.toString()
}
fun test() {
val a = 1
}
fun otherTest() {
}
}
}
@@ -10,12 +10,15 @@ class C : A() {
override fun equals(other: Any?): Boolean {
return super<A>.equals(other)
}
override fun foo(value: Int) {
super<A>.foo(value)
}
override fun hashCode(): Int {
return super<A>.hashCode()
}
override fun toString(): String {
return super<A>.toString()
}
@@ -8,6 +8,7 @@ class SomeTest : Test {
override fun test() {
<selection><caret>throw UnsupportedOperationException()</selection>
}
override val testProp: Int = 0
/**
* test
@@ -2,6 +2,7 @@ fun foo() {
class A {
fun test() {}
}
val d: A
if (<caret>) {
d = A()
@@ -0,0 +1,9 @@
trait Some {
fun f1()
fun f2()
}
abstract class Abstract() {
abstract fun f1()
abstract fun f2()
}
@@ -0,0 +1,9 @@
trait Some {
fun f1()
fun f2()
}
abstract class Abstract() {
abstract fun f1()
abstract fun f2()
}
@@ -0,0 +1,48 @@
fun f1() {
}
class C1 {}
// -----
fun f2() {
}
class C2
// -----
fun f3 = 1
class C3 {}
// -----
fun f4 = 2
class C4
// -----
class C5 {}
fun f5() {
}
// -----
class C6
fun f6() {
}
// -----
class C7 {}
fun f7 = 1
// -----
class C8
fun f8 = 1
@@ -0,0 +1,38 @@
fun f1() {}
class C1 {}
// -----
fun f2() {}
class C2
// -----
fun f3 = 1
class C3 {}
// -----
fun f4 = 2
class C4
// -----
class C5 {}
fun f5() {}
// -----
class C6
fun f6() {}
// -----
class C7 {}
fun f7 = 1
// -----
class C8
fun f8 = 1
@@ -0,0 +1,25 @@
class A
class B
class C {
}
class D {
}
class E
: Some
class F
fun some() = 1
class G
fun some() = 1
val a = 1
class H
val b = 1
@@ -0,0 +1,19 @@
class A
class B
class C {
}
class D {
}
class E
: Some
class F
fun some() = 1
class G
fun some() = 1
val a = 1
class H
val b = 1
@@ -0,0 +1,76 @@
// No lines
fun f1() {
}
val p1 = 1
fun f2() {
}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {
}
val p3: Int
get() = 1
fun f5() = 1
class OneLine {
fun f1() {
}
val p1 = 1
fun f2() {
}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {
}
val p3: Int
get() = 1
fun f5() = 1
}
class TwoLines {
fun f1() {
}
val p1 = 1
fun f2() {
}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {
}
val p3: Int
get() = 1
fun f5() = 1
}
@@ -0,0 +1,64 @@
// No lines
fun f1() {}
val p1 = 1
fun f2() {}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {}
val p3: Int
get() = 1
fun f5() = 1
class OneLine {
fun f1() {}
val p1 = 1
fun f2() {}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {}
val p3: Int
get() = 1
fun f5() = 1
}
class TwoLines {
fun f1() {}
val p1 = 1
fun f2() {}
fun f3() = 1
val p2 = 1
fun f4() = 1
fun f4() {}
val p3: Int
get() = 1
fun f5() = 1
}
@@ -0,0 +1,66 @@
// No lines between
fun f2() {
}
fun f1() {
}
fun f3() = 1
fun f4() {
}
fun f5() {
}
fun f6() = 1
fun f7() = 8
// One line
fun f2() {
}
fun f1() {
}
fun f3() = 1
fun f4() {
}
fun f5() {
}
fun f6() = 1
fun f7() = 8
// Two lines between
fun l1() {
}
fun l2() {
}
fun l3() = 1
fun l4() {
}
fun l5() {
}
fun l6() = 1
fun l7() = 8
@@ -0,0 +1,53 @@
// No lines between
fun f2() {}
fun f1() {}
fun f3() = 1
fun f4() {}
fun f5() {
}
fun f6() = 1
fun f7() = 8
// One line
fun f2() {}
fun f1() {}
fun f3() = 1
fun f4() {}
fun f5() {
}
fun f6() = 1
fun f7() = 8
// Two lines between
fun l1() {}
fun l2() {}
fun l3() = 1
fun l4() {}
fun l5() {
}
fun l6() = 1
fun l7() = 8
@@ -0,0 +1,42 @@
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() {
return 1
}
val p5: Int
class OneLine {
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() {
return 1
}
val p5: Int
}
class TwoLines {
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() {
return 1
}
val p5: Int
}
@@ -0,0 +1,36 @@
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() { return 1 }
val p5: Int
class OneLine {
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() { return 1 }
val p5: Int
}
class TwoLines {
val p1 by Some
val p2 = 1
val p3: Int get() = 3
val p4: Int
get() { return 1 }
val p5: Int
}
@@ -4,6 +4,7 @@ class Foo<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y["", w]
}
@@ -4,6 +4,7 @@ class Foo<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z = y["", w]
}
@@ -5,6 +5,7 @@ class A<T>(val n: T) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class B<T>(val m: T)
fun test(): B<String> {
@@ -5,6 +5,7 @@ class A<T>(val n: T) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class B<T>(val m: T)
fun test<U, V>(u: U): B<V> {
@@ -4,6 +4,7 @@ class Foo<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
for (i: Int in Foo<Int>()) { }
}
@@ -4,6 +4,7 @@ class Foo<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
for (i in Foo<Int>()) {
bar(i)