Smart completion: bugfix - no function reference after dot

This commit is contained in:
Valentin Kipyatkov
2014-04-15 13:04:21 +04:00
parent 5bff98c164
commit 1ba4c656a5
3 changed files with 19 additions and 1 deletions
@@ -89,7 +89,9 @@ class SmartCompletion(val expression: JetSimpleNameExpression,
result.add(addTailToLookupElement(lookupElement, matchedExpectedTypes))
}
toFunctionReferenceLookupElement(descriptor, functionExpectedTypes)?.let { result.add(it) }
if (receiver == null) {
toFunctionReferenceLookupElement(descriptor, functionExpectedTypes)?.let { result.add(it) }
}
}
if (receiver == null) {
@@ -0,0 +1,11 @@
class X{
fun foo(p: () -> Unit){}
fun bar() {
foo(this.<caret>)
}
fun f(){}
}
// NUMBER: 0
@@ -211,6 +211,11 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
doTest("idea/testData/completion/smart/NoConstructorWithQualifier.kt");
}
@TestMetadata("NoFunctionReferenceAfterQualifier.kt")
public void testNoFunctionReferenceAfterQualifier() throws Exception {
doTest("idea/testData/completion/smart/NoFunctionReferenceAfterQualifier.kt");
}
@TestMetadata("NoNothing.kt")
public void testNoNothing() throws Exception {
doTest("idea/testData/completion/smart/NoNothing.kt");