FIR Completion: Fix completion in function calls (foo.bar<caret>())

In such expressions, `KtCallExpression` wraps `KtSimpleNameExpression`,
so `getQualifiedExpressionForSelector()` returns `null`

Also, enable tests that are fixed by this
This commit is contained in:
Roman Golyshev
2020-09-09 13:12:30 +03:00
parent 2d4d48b401
commit 7bd9c52732
7 changed files with 35 additions and 5 deletions
@@ -1,3 +1,5 @@
// FIR_COMPARISON
infix fun Int.func(s: String): Int{}
fun test() {
@@ -0,0 +1,13 @@
// FIR_COMPARISON
class LocalClass
fun LocalClass.ext(action: () -> Unit) {}
fun LocalClass.extAnother(action: () -> Unit) {}
fun usage(l: LocalClass) {
l.ext<caret> {}
}
// EXIST: ext
// EXIST: extAnother
@@ -1,3 +1,5 @@
// FIR_COMPARISON
class Expr {}
class Num : Expr() {
fun testing() {}
@@ -2297,6 +2297,11 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/extensionPropertyAndFunctionImplicitReceiver.kt");
}
@TestMetadata("extensionRecompletion.kt")
public void testExtensionRecompletion() throws Exception {
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/extensionRecompletion.kt");
}
@TestMetadata("genericExtensionPropertyAndFunctionExplicitReceiver.kt")
public void testGenericExtensionPropertyAndFunctionExplicitReceiver() throws Exception {
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/genericExtensionPropertyAndFunctionExplicitReceiver.kt");
@@ -2297,6 +2297,11 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/extensionPropertyAndFunctionImplicitReceiver.kt");
}
@TestMetadata("extensionRecompletion.kt")
public void testExtensionRecompletion() throws Exception {
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/extensionRecompletion.kt");
}
@TestMetadata("genericExtensionPropertyAndFunctionExplicitReceiver.kt")
public void testGenericExtensionPropertyAndFunctionExplicitReceiver() throws Exception {
runTest("idea/idea-completion/testData/basic/common/primitiveCompletion/genericExtensionPropertyAndFunctionExplicitReceiver.kt");