Fix wrong unnecessary completion for the case of force completion
#KT-1187 Fixed
This commit is contained in:
@@ -45,6 +45,7 @@ import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
|
|||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
|
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils;
|
import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils;
|
||||||
import org.jetbrains.jet.plugin.caches.resolve.IDELightClassGenerationSupport;
|
import org.jetbrains.jet.plugin.caches.resolve.IDELightClassGenerationSupport;
|
||||||
@@ -308,7 +309,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
|
|||||||
JetType expressionType = context.get(BindingContext.EXPRESSION_TYPE, receiverExpression);
|
JetType expressionType = context.get(BindingContext.EXPRESSION_TYPE, receiverExpression);
|
||||||
JetScope scope = context.get(BindingContext.RESOLUTION_SCOPE, receiverExpression);
|
JetScope scope = context.get(BindingContext.RESOLUTION_SCOPE, receiverExpression);
|
||||||
|
|
||||||
if (expressionType != null && scope != null) {
|
if (expressionType != null && scope != null && !ErrorUtils.isErrorType(expressionType)) {
|
||||||
Collection<String> extensionFunctionsNames = getAllJetExtensionFunctionsNames(searchScope);
|
Collection<String> extensionFunctionsNames = getAllJetExtensionFunctionsNames(searchScope);
|
||||||
|
|
||||||
Set<FqName> functionFQNs = new java.util.HashSet<FqName>();
|
Set<FqName> functionFQNs = new java.util.HashSet<FqName>();
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ fun anyfun() {
|
|||||||
a.b.c.d.e.f.<caret>
|
a.b.c.d.e.f.<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TIME: 1
|
||||||
// NUMBER: 0
|
// NUMBER: 0
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/// KT-1187 Wrong unnecessary completion
|
||||||
|
|
||||||
|
fun anyfun() {
|
||||||
|
a.b.c.d.e.f.<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// TIME: 2
|
||||||
|
// NUMBER: 0
|
||||||
@@ -104,6 +104,11 @@ public class JetBasicJSCompletionTestGenerated extends AbstractJetJSCompletionTe
|
|||||||
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceivers.kt");
|
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceivers.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("DoNotCompleteForErrorReceiversForce.kt")
|
||||||
|
public void testDoNotCompleteForErrorReceiversForce() throws Exception {
|
||||||
|
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceiversForce.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ExtendClassName.kt")
|
@TestMetadata("ExtendClassName.kt")
|
||||||
public void testExtendClassName() throws Exception {
|
public void testExtendClassName() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/ExtendClassName.kt");
|
doTest("idea/testData/completion/basic/common/ExtendClassName.kt");
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ public class JetBasicJavaCompletionTestGenerated extends AbstractJavaCompletionT
|
|||||||
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceivers.kt");
|
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceivers.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("DoNotCompleteForErrorReceiversForce.kt")
|
||||||
|
public void testDoNotCompleteForErrorReceiversForce() throws Exception {
|
||||||
|
doTest("idea/testData/completion/basic/common/DoNotCompleteForErrorReceiversForce.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ExtendClassName.kt")
|
@TestMetadata("ExtendClassName.kt")
|
||||||
public void testExtendClassName() throws Exception {
|
public void testExtendClassName() throws Exception {
|
||||||
doTest("idea/testData/completion/basic/common/ExtendClassName.kt");
|
doTest("idea/testData/completion/basic/common/ExtendClassName.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user