Immediate extension members are correctly detected for platform types
This commit is contained in:
@@ -37,6 +37,7 @@ import com.intellij.codeInsight.lookup.LookupElementPresentation
|
|||||||
import org.jetbrains.jet.lang.types.JetType
|
import org.jetbrains.jet.lang.types.JetType
|
||||||
import org.jetbrains.jet.plugin.caches.resolve.ResolutionFacade
|
import org.jetbrains.jet.plugin.caches.resolve.ResolutionFacade
|
||||||
import java.awt.Color
|
import java.awt.Color
|
||||||
|
import org.jetbrains.jet.lang.types.TypeUtils
|
||||||
|
|
||||||
public open class LookupElementFactory protected() {
|
public open class LookupElementFactory protected() {
|
||||||
public open fun createLookupElement(resolutionFacade: ResolutionFacade, descriptor: DeclarationDescriptor): LookupElement {
|
public open fun createLookupElement(resolutionFacade: ResolutionFacade, descriptor: DeclarationDescriptor): LookupElement {
|
||||||
@@ -171,7 +172,7 @@ public class BoldImmediateLookupElementFactory(private val receiverTypes: Collec
|
|||||||
val receiverParamType = receiverParameter.getType()
|
val receiverParamType = receiverParameter.getType()
|
||||||
if (isReceiverNullable && !receiverParamType.isNullable())
|
if (isReceiverNullable && !receiverParamType.isNullable())
|
||||||
Style.GRAYED
|
Style.GRAYED
|
||||||
else if (receiverTypes.any { it == receiverParamType })
|
else if (receiverTypes.any { TypeUtils.equalTypes(it, receiverParamType) })
|
||||||
Style.BOLD
|
Style.BOLD
|
||||||
else
|
else
|
||||||
Style.NORMAL
|
Style.NORMAL
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
fun String.extFunForString(){}
|
||||||
|
fun Any.extFunForAny(){}
|
||||||
|
fun String?.extFunForStringNullable(){}
|
||||||
|
|
||||||
|
class C {
|
||||||
|
fun foo() {
|
||||||
|
System.getProperty("a").<caret>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXIST: { itemText: "extFunForString", attributes: "bold" }
|
||||||
|
// EXIST: { itemText: "extFunForAny", attributes: "" }
|
||||||
|
// EXIST: { itemText: "extFunForStringNullable", attributes: "bold" }
|
||||||
|
// EXIST: { itemText: "charAt", attributes: "bold" }
|
||||||
@@ -1033,6 +1033,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ImmediateMembersForPlatformType.kt")
|
||||||
|
public void testImmediateMembersForPlatformType() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/java/ImmediateMembersForPlatformType.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("InPackage.kt")
|
@TestMetadata("InPackage.kt")
|
||||||
public void testInPackage() throws Exception {
|
public void testInPackage() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/java/InPackage.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/java/InPackage.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user