Smart completion: java static members, enum members and class object members added

This commit is contained in:
Valentin Kipyatkov
2013-12-12 22:32:53 +04:00
parent dbaaa80918
commit db77eb54d7
23 changed files with 263 additions and 3 deletions
@@ -0,0 +1,21 @@
package sample
class K {
class object {
val foo: K = K()
fun bar(): K = K()
val x: String = ""
var kk: K? = null
private val privateVal: K = K()
}
}
fun foo(){
val k : K = <caret>
}
// EXIST: { lookupString:"K.foo", itemText:"K.foo", tailText:" (sample)", typeText:"sample.K" }
// EXIST: { lookupString:"K.bar", itemText:"K.bar()", tailText:" (sample)", typeText:"sample.K" }
// ABSENT: K.x
// ABSENT: K.kk
// ABSENT: K.privateVal
@@ -0,0 +1,19 @@
package sample
class K {
class object {
val foo: K = K()
fun bar(): K = K()
val x: String = ""
var kk: K? = null
}
}
fun foo(){
val k : K? = <caret>
}
// EXIST: { lookupString:"K.foo", itemText:"K.foo", tailText:" (sample)", typeText:"sample.K" }
// EXIST: { lookupString:"K.bar", itemText:"K.bar()", tailText:" (sample)", typeText:"sample.K" }
// ABSENT: K.x
// EXIST: { lookupString:"K.kk", itemText:"K.kk", tailText:" (sample)", typeText:"sample.K?" }
@@ -0,0 +1,13 @@
package sample
enum class Foo {
X
Y
}
fun foo(){
val f : Foo = <caret>
}
// EXIST: { lookupString:"Foo.X", itemText:"Foo.X", tailText:" (sample)", typeText:"sample.Foo" }
// EXIST: { lookupString:"Foo.Y", itemText:"Foo.Y", tailText:" (sample)", typeText:"sample.Foo" }
@@ -0,0 +1,8 @@
import java.lang.annotation.ElementType
fun foo(){
val e : ElementType = <caret>
}
// EXIST: { lookupString:"ElementType.TYPE", itemText:"ElementType.TYPE", tailText:" (java.lang.annotation)", typeText:"java.lang.annotation.ElementType" }
// EXIST: { lookupString:"ElementType.FIELD", itemText:"ElementType.FIELD", tailText:" (java.lang.annotation)", typeText:"java.lang.annotation.ElementType" }
@@ -0,0 +1,8 @@
import java.lang.annotation.ElementType
fun foo(){
var e : ElementType? = <caret>
}
// EXIST: { lookupString:"ElementType.TYPE", itemText:"ElementType.TYPE", tailText:" (java.lang.annotation)", typeText:"java.lang.annotation.ElementType" }
// EXIST: { lookupString:"ElementType.FIELD", itemText:"ElementType.FIELD", tailText:" (java.lang.annotation)", typeText:"java.lang.annotation.ElementType" }
@@ -0,0 +1,6 @@
fun foo(){
var l : java.util.Locale = <caret>
}
// EXIST: { lookupString:"Locale.ENGLISH", itemText:"Locale.ENGLISH", tailText:" (java.util)", typeText:"Locale" }
// EXIST: { lookupString:"Locale.FRENCH", itemText:"Locale.FRENCH", tailText:" (java.util)", typeText:"Locale" }
@@ -0,0 +1,6 @@
fun foo(){
var l : java.util.Locale? = <caret>
}
// EXIST: { lookupString:"Locale.ENGLISH", itemText:"Locale.ENGLISH", tailText:" (java.util)", typeText:"Locale" }
// EXIST: { lookupString:"Locale.FRENCH", itemText:"Locale.FRENCH", tailText:" (java.util)", typeText:"Locale" }
@@ -0,0 +1,5 @@
fun foo(){
val l : java.lang.Thread = <caret>
}
// EXIST: { lookupString:"Thread.currentThread", itemText:"Thread.currentThread()", tailText:" (java.lang)", typeText:"Thread" }