FIR IDE: add completion weighers tests for return/if/while

This commit is contained in:
Ilya Kirillov
2020-12-13 17:57:30 +01:00
parent b16ebe2dc4
commit 7be8d69870
7 changed files with 159 additions and 0 deletions
@@ -0,0 +1,18 @@
// FIR_COMPARISON
object x {
val b: Boolean = true
val c: String = "true"
val d: Int = 1
val e: Long = 1L
val f: Boolean = true
fun foo(): Boolean = true
}
fun test() {
if(x.<caret>){
}
// ORDER: b, f, foo
@@ -0,0 +1,13 @@
val b: Boolean = true
val c: String = "true"
val d: Int = 1
val e: Long = 1L
val f: Boolean = true
fun foo(): Boolean
fun test(): Int {
return <caret>
}
//ORDER: test, d
@@ -0,0 +1,17 @@
// FIR_COMPARISON
object x {
val b: Boolean = true
val c: String = "true"
val d: Int = 1
val e: Long = 1L
val f: Boolean = true
fun foo(): Int
}
fun test(): Int {
return x.<caret>
}
//ORDER: d, foo, f
@@ -0,0 +1,17 @@
// FIR_COMPARISON
val a: Int
val b: String
val c: Long
val d: Int
fun test(): Int {
receiveLambda {
return@receiveLambda <caret>
}
return 2
}
fun receiveLambda(x: () -> Int){}
// ORDER: a, d, test
@@ -0,0 +1,18 @@
// FIR_COMPARISON
object x {
val b: Boolean = true
val c: String = "true"
val d: Int = 1
val e: Long = 1L
val f: Boolean = true
fun foo(): Boolean = true
}
fun x() {
while(x.<caret>){
}
// ORDER: b, f, foo