Completion and import popup for bound callable references
This commit is contained in:
+78
@@ -0,0 +1,78 @@
|
||||
abstract class A {
|
||||
abstract fun memberFunInA()
|
||||
abstract val memberValInA: Int
|
||||
|
||||
inner class InnerInA
|
||||
class NestedInA
|
||||
}
|
||||
|
||||
abstract class B : A() {
|
||||
abstract fun memberFunInB()
|
||||
abstract val memberValInB: Int
|
||||
|
||||
inner class InnerInB
|
||||
class NestedInB
|
||||
}
|
||||
|
||||
fun A.extensionFun(){}
|
||||
|
||||
val A.extensionVal: Int
|
||||
get() = 1
|
||||
|
||||
fun B.extensionFunForB(){}
|
||||
|
||||
fun Any.anyExtensionFun(){}
|
||||
fun String.wrongExtensionFun(){}
|
||||
|
||||
fun globalFun(p: Int) {}
|
||||
val globalVal = 1
|
||||
|
||||
class C {
|
||||
fun memberFun(){}
|
||||
|
||||
val memberVal = 1
|
||||
|
||||
fun A.memberExtensionFun(){}
|
||||
|
||||
fun foo(a: A) {
|
||||
fun localFun(){}
|
||||
|
||||
if (a is B) {
|
||||
val v = a::<caret>
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun companionObjectFun(){}
|
||||
|
||||
fun A.companionExtension(){}
|
||||
}
|
||||
}
|
||||
|
||||
// ABSENT: class
|
||||
// ABSENT: class.java
|
||||
// EXIST: { itemText: "memberFunInA", attributes: "" }
|
||||
// EXIST: { itemText: "memberValInA", attributes: "" }
|
||||
|
||||
/*TODO!*/
|
||||
// ABSENT: { itemText: "InnerInA", attributes: "" }
|
||||
|
||||
// ABSENT: NestedInA
|
||||
// EXIST: { itemText: "extensionFun", attributes: "" }
|
||||
// EXIST: { itemText: "extensionVal", attributes: "" }
|
||||
// EXIST: { itemText: "anyExtensionFun", attributes: "" }
|
||||
// ABSENT: wrongExtensionFun
|
||||
// ABSENT: globalFun
|
||||
// ABSENT: globalVal
|
||||
// ABSENT: memberFun
|
||||
// ABSENT: memberVal
|
||||
// ABSENT: memberExtensionFun
|
||||
// ABSENT: localFun
|
||||
// ABSENT: companionObjectFun
|
||||
// ABSENT: companionExtension
|
||||
|
||||
// EXIST: { itemText: "memberFunInB", attributes: "bold" }
|
||||
// EXIST: { itemText: "memberValInB", attributes: "bold" }
|
||||
// EXIST: { itemText: "InnerInB", attributes: "bold" }
|
||||
// ABSENT: NestedInB
|
||||
// EXIST: { itemText: "extensionFunForB", attributes: "bold" }
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.io.File
|
||||
|
||||
fun f(file: File) {
|
||||
val v = file::<caret>
|
||||
}
|
||||
|
||||
// EXIST_JAVA_ONLY: { itemText: "getFreeSpace", tailText: "()", attributes: "bold" }
|
||||
// ABSENT: freeSpace
|
||||
// EXIST_JAVA_ONLY: { itemText: "isFile", tailText: "()", attributes: "bold" }
|
||||
// ABSENT: { itemText: "isFile", tailText: " (from isFile())" }
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package dependency
|
||||
|
||||
fun CharSequence.extFun(){}
|
||||
|
||||
val String.extVal: Int get() = 1
|
||||
|
||||
fun Int.wrongExtFun(){}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
val v = "a"::<caret>
|
||||
|
||||
// EXIST: extFun
|
||||
// EXIST: extVal
|
||||
// ABSENT: wrongExtFun
|
||||
+12
@@ -1200,6 +1200,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ExpressionQualifier.kt")
|
||||
public void testExpressionQualifier() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/ExpressionQualifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("HigherOrderFunction.kt")
|
||||
public void testHigherOrderFunction() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/HigherOrderFunction.kt");
|
||||
@@ -1217,6 +1223,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/SyntheticExtensions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensions2.kt")
|
||||
public void testSyntheticExtensions2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/SyntheticExtensions2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/extensionFunctionTypeValues")
|
||||
|
||||
+12
@@ -1200,6 +1200,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ExpressionQualifier.kt")
|
||||
public void testExpressionQualifier() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/ExpressionQualifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("HigherOrderFunction.kt")
|
||||
public void testHigherOrderFunction() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/HigherOrderFunction.kt");
|
||||
@@ -1217,6 +1223,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/SyntheticExtensions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensions2.kt")
|
||||
public void testSyntheticExtensions2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/callableReference/SyntheticExtensions2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/extensionFunctionTypeValues")
|
||||
|
||||
+6
@@ -47,6 +47,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("CallableReferenceNotImportedExtension2")
|
||||
public void testCallableReferenceNotImportedExtension2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/CallableReferenceNotImportedExtension2/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("CallablesInExcludedPackage")
|
||||
public void testCallablesInExcludedPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/CallablesInExcludedPackage/");
|
||||
|
||||
Reference in New Issue
Block a user