KT-1633 support completion of named function parameters
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
fun small(param: Int) {
|
||||
}
|
||||
|
||||
fun test() = small(<caret>)
|
||||
|
||||
// EXIST: {"lookupString":"param","tailText":"Int","itemText":"param = "}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun small(first: Int, second: Int) {
|
||||
}
|
||||
|
||||
fun test() = small(12, <caret>)
|
||||
|
||||
// ABSENT: first
|
||||
// EXIST: second
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
val paramTest = 12
|
||||
|
||||
fun small(paramFirst: ArrayList<String>, paramSecond: Comparable<java.lang.RuntimeException>) {
|
||||
}
|
||||
|
||||
fun test() = small(<caret>)
|
||||
|
||||
// EXIST: {"lookupString":"paramSecond","tailText":"Comparable<RuntimeException>","itemText":"paramSecond = "}
|
||||
// EXIST: {"lookupString":"paramFirst","tailText":"ArrayList<String>","itemText":"paramFirst = "}
|
||||
@@ -0,0 +1,11 @@
|
||||
val paramTest = 12
|
||||
|
||||
fun small(paramFirst: Int, paramSecond: Int) {
|
||||
}
|
||||
|
||||
fun test() = small(paramFirst = param<caret>)
|
||||
|
||||
// EXIST: paramTest
|
||||
// ABSENT: {"lookupString":"paramFirst","tailText":"Int","itemText":"paramFirst = "}
|
||||
// ABSENT: paramSecond
|
||||
// NUMBER: 1
|
||||
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
val nLocal = 12
|
||||
|
||||
class foo(nClassParam: String, val nClassField: String)
|
||||
fun foo(nFirst: String) = 12
|
||||
fun foo(nSecond: String? = null, nThird: Int = 1) { }
|
||||
|
||||
fun other() {
|
||||
foo(n<caret>)
|
||||
}
|
||||
|
||||
// EXIST: nFirst
|
||||
// EXIST: nSecond
|
||||
// EXIST: nThird
|
||||
// EXIST: nLocal
|
||||
|
||||
// todo - should exist
|
||||
// ABSENT: nClassParam
|
||||
// ABSENT: nClassField
|
||||
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
class Foo(pFirst: String? = null, val pSecond: Int = 1) { }
|
||||
|
||||
fun other() {
|
||||
Foo(p<caret>)
|
||||
}
|
||||
|
||||
// EXIST: {"lookupString":"pFirst","tailText":"String?","itemText":"pFirst = "}
|
||||
// EXIST: {"lookupString":"pSecond","tailText":"Int","itemText":"pSecond = "}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun foo(paramFirst: String, paramSecond: String, paramThird: String, paramFourth: String) {}
|
||||
|
||||
fun test() {
|
||||
foo("str", paramThird = "test", param<caret>)
|
||||
}
|
||||
|
||||
// ABSENT: paramFirst
|
||||
// EXIST: paramSecond
|
||||
// ABSENT: paramThird
|
||||
// EXIST: paramFourth
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo(paramFirst: Int, paramSecond: Int) = 12
|
||||
fun foo(paramThird: String, paramFourth: String) = 1
|
||||
|
||||
fun test() {
|
||||
foo(12, param<caret>)
|
||||
}
|
||||
|
||||
// ABSENT: paramFirst
|
||||
// EXIST: {"lookupString":"paramSecond","tailText":"Int","itemText":"paramSecond = "}
|
||||
// ABSENT: paramThird
|
||||
// ABSENT: paramFourth
|
||||
@@ -0,0 +1,12 @@
|
||||
val paramTest = 12
|
||||
|
||||
fun small(paramFirst: Int, paramSecond: Int) {
|
||||
}
|
||||
|
||||
fun test() = small(param<caret>First = 12)
|
||||
|
||||
// EXIST: paramFirst
|
||||
// EXIST: paramSecond
|
||||
// ABSENT: paramTest
|
||||
|
||||
// NUMBER: 2
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo(paramTest: Int = 12)
|
||||
|
||||
fun test() {
|
||||
// '=' is expected
|
||||
foo(param<caret>)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo(paramTest: Int = 12)
|
||||
|
||||
fun test() {
|
||||
// '=' is expected
|
||||
foo(paramTest = <caret>)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
val paramVal = 12
|
||||
fun foo(paramTest: Int = 12)
|
||||
fun paramFun() {}
|
||||
|
||||
fun test() {
|
||||
// Type '=', completion should be finishied
|
||||
foo(param<caret>)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
val paramVal = 12
|
||||
fun foo(paramTest: Int = 12)
|
||||
fun paramFun() {}
|
||||
|
||||
fun test() {
|
||||
// Type '=', completion should be finishied
|
||||
foo(paramTest = <caret>)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package temp.test
|
||||
|
||||
class Options(val listNew: Boolean, val listMatch: Boolean) {
|
||||
}
|
||||
|
||||
fun listImportedFun() = 12
|
||||
val listImportedVal = 11
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package test
|
||||
|
||||
import temp.test.*
|
||||
|
||||
val listThisFileVal = 12
|
||||
fun listThisFileFun() = 1
|
||||
|
||||
class ListThisFileClass {}
|
||||
|
||||
fun test(listParam: Int) {
|
||||
val listLocalVal = 12
|
||||
Options(list<caret>)
|
||||
}
|
||||
|
||||
// ORDER: listLocalVal
|
||||
// ORDER: listParam
|
||||
// ORDER: listThisFileVal
|
||||
// ORDER: listImportedVal
|
||||
// ORDER: listMatch
|
||||
// ORDER: listNew
|
||||
// ORDER: listThisFileFun
|
||||
// ORDER: listImportedFun
|
||||
Reference in New Issue
Block a user