Smart completion: 2 lookup strings for static member items
This commit is contained in:
@@ -110,6 +110,10 @@ class StaticMembers(val bindingContext: BindingContext, val resolveSession: Reso
|
|||||||
val qualifierText = qualifiedNameForSourceCode(classDescriptor)
|
val qualifierText = qualifiedNameForSourceCode(classDescriptor)
|
||||||
|
|
||||||
return object: LookupElementDecorator<LookupElement>(lookupElement) {
|
return object: LookupElementDecorator<LookupElement>(lookupElement) {
|
||||||
|
override fun getAllLookupStrings(): Set<String> {
|
||||||
|
return setOf(lookupElement.getLookupString(), qualifierPresentation)
|
||||||
|
}
|
||||||
|
|
||||||
override fun renderElement(presentation: LookupElementPresentation) {
|
override fun renderElement(presentation: LookupElementPresentation) {
|
||||||
getDelegate().renderElement(presentation)
|
getDelegate().renderElement(presentation)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package sample
|
||||||
|
|
||||||
|
class Kool {
|
||||||
|
class object {
|
||||||
|
val foo: Kool = Kool()
|
||||||
|
fun bar(): Kool = Kool()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun foo(){
|
||||||
|
val k : Kool = K<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXIST: foo
|
||||||
|
// EXIST: bar
|
||||||
@@ -19,7 +19,6 @@ package org.jetbrains.jet.completion;
|
|||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.test.InnerTestClasses;
|
|
||||||
import org.jetbrains.jet.test.TestMetadata;
|
import org.jetbrains.jet.test.TestMetadata;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -150,6 +149,12 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassObjectMembersWithPrefix.kt")
|
||||||
|
public void testClassObjectMembersWithPrefix() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/smart/ClassObjectMembersWithPrefix.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("Constructor.kt")
|
@TestMetadata("Constructor.kt")
|
||||||
public void testConstructor() throws Exception {
|
public void testConstructor() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/smart/Constructor.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/smart/Constructor.kt");
|
||||||
|
|||||||
+1
@@ -19,6 +19,7 @@ package org.jetbrains.jet.completion.weighers;
|
|||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
|
import org.jetbrains.jet.test.InnerTestClasses;
|
||||||
import org.jetbrains.jet.test.TestMetadata;
|
import org.jetbrains.jet.test.TestMetadata;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user