Better completion for static members: special behavior in case of imports from same class exist

This commit is contained in:
Valentin Kipyatkov
2015-11-02 21:21:11 +03:00
parent ca437e51c4
commit 06812aed11
20 changed files with 281 additions and 47 deletions
@@ -0,0 +1,23 @@
package a
import a.O.xxxVal1
import a.O.xxxFun1
object O {
fun xxxFun1() { }
fun xxxFun2() { }
val xxxVal1 = 1
val xxxVal2 = 2
}
fun main() {
xxx<caret>
}
// INVOCATION_COUNT: 2
// EXIST: { allLookupStrings: "xxxFun1", itemText: "xxxFun1" }
// EXIST: { allLookupStrings: "xxxFun2", itemText: "O.xxxFun2" }
// EXIST: { allLookupStrings: "getXxxVal1, xxxVal1", itemText: "xxxVal1" }
// EXIST: { allLookupStrings: "getXxxVal2, xxxVal2", itemText: "O.xxxVal2" }
// NOTHING_ELSE
@@ -0,0 +1,9 @@
import java.awt.GridBagConstraints.NORTH
fun foo() {
SOUT<caret>
}
// INVOCATION_COUNT: 1
// EXIST_JAVA_ONLY: { allLookupStrings: "SOUTH, getSOUTH", itemText: "GridBagConstraints.SOUTH", tailText: " (java.awt)", typeText: "Int", attributes: "" }
// ABSENT: { itemText: "SwingConstants.SOUTH" }
@@ -0,0 +1,10 @@
import java.util.Collections.singletonList
fun foo() {
singl<caret>
}
// INVOCATION_COUNT: 1
// EXIST_JAVA_ONLY: { allLookupStrings: "singleton", itemText: "Collections.singleton", tailText: "(T!) (java.util)", typeText: "(Mutable)Set<T!>!", attributes: "" }
// ABSENT: { itemText: "Collections.singletonList" }
// EXIST_JAVA_ONLY: { itemText: "singletonList", tailText: "(T!)", typeText: "(Mutable)List<T!>!", attributes: "" }
@@ -0,0 +1,9 @@
import java.util.Collections.max
fun foo() {
lastIndexOfSub<caret>
}
// INVOCATION_COUNT: 2
// EXIST_JAVA_ONLY: { allLookupStrings: "lastIndexOfSubList", itemText: "Collections.lastIndexOfSubList" }
// NOTHING_ELSE
@@ -0,0 +1,11 @@
import javax.swing.SwingUtilities
class A : SwingUtilities {
fun foo() {
invoke<caret>
}
}
// INVOCATION_COUNT: 2
// ABSENT: { itemText: "SwingUtilities.invokeLater" }
// EXIST_JAVA_ONLY: { itemText: "invokeLater" }