KT-19145: Enable type completion for extension properties

#KT-19145 fixed
This commit is contained in:
Simon Ogorodnik
2017-07-25 19:50:54 +03:00
parent 68659f5a32
commit c41c5f1916
4 changed files with 19 additions and 1 deletions
@@ -198,7 +198,7 @@ class BasicCompletionSession(
// no auto-popup on typing after "val", "var" and "fun" because it's likely the name of the declaration which is being typed by user
if (parameters.invocationCount == 0) {
val suppressOtherCompletion = when (declaration) {
is KtNamedFunction -> prefixMatcher.prefix.let { it.isEmpty() || it[0].isLowerCase() /* function name usually starts with lower case letter */ }
is KtNamedFunction, is KtProperty -> prefixMatcher.prefix.let { it.isEmpty() || it[0].isLowerCase() /* function name usually starts with lower case letter */ }
else -> true
}
if (suppressOtherCompletion) return
@@ -0,0 +1,6 @@
class Some
val S<caret>
// INVOCATION_COUNT: 0
// EXIST: Some
@@ -1075,6 +1075,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
doTest(fileName);
}
@TestMetadata("InValExtType.kt")
public void testInValExtType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/autoPopup/InValExtType.kt");
doTest(fileName);
}
@TestMetadata("NoAutoPopupAfterNumberLiteral.kt")
public void testNoAutoPopupAfterNumberLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/autoPopup/NoAutoPopupAfterNumberLiteral.kt");
@@ -1075,6 +1075,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
doTest(fileName);
}
@TestMetadata("InValExtType.kt")
public void testInValExtType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/autoPopup/InValExtType.kt");
doTest(fileName);
}
@TestMetadata("NoAutoPopupAfterNumberLiteral.kt")
public void testNoAutoPopupAfterNumberLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/autoPopup/NoAutoPopupAfterNumberLiteral.kt");