diff --git a/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/HighLevelApiLookupElementFactory.kt b/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/HighLevelApiLookupElementFactory.kt index b0aa7ba55e9..5af26d0b342 100644 --- a/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/HighLevelApiLookupElementFactory.kt +++ b/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/HighLevelApiLookupElementFactory.kt @@ -28,12 +28,14 @@ internal class HighLevelApiLookupElementFactory { private val classLookupElementFactory = ClassLookupElementFactory() private val variableLookupElementFactory = VariableLookupElementFactory() private val functionLookupElementFactory = FunctionLookupElementFactory() + private val typeParameterLookupElementFactory = TypeParameterLookupElementFactory() fun createLookupElement(symbol: KtNamedSymbol): LookupElement { val elementBuilder = when (symbol) { is KtFunctionSymbol -> functionLookupElementFactory.createLookup(symbol) is KtVariableLikeSymbol -> variableLookupElementFactory.createLookup(symbol) is KtClassLikeSymbol -> classLookupElementFactory.createLookup(symbol) + is KtTypeParameterSymbol -> typeParameterLookupElementFactory.createLookup(symbol) else -> throw IllegalArgumentException("Cannot create a lookup element for $symbol") } @@ -54,6 +56,12 @@ private class ClassLookupElementFactory { } } +private class TypeParameterLookupElementFactory { + fun createLookup(symbol: KtTypeParameterSymbol): LookupElementBuilder { + return LookupElementBuilder.create(UniqueLookupObject(), symbol.name.asString()) + } +} + private class VariableLookupElementFactory { fun createLookup(symbol: KtVariableLikeSymbol): LookupElementBuilder { return LookupElementBuilder.create(UniqueLookupObject(), symbol.name.asString()) diff --git a/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/KotlinFirCompletionContributor.kt b/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/KotlinFirCompletionContributor.kt index 8a858503208..3c67a23befa 100644 --- a/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/KotlinFirCompletionContributor.kt +++ b/idea/idea-fir/src/org/jetbrains/kotlin/idea/completion/KotlinFirCompletionContributor.kt @@ -136,7 +136,7 @@ private object KotlinAvailableScopesCompletionContributor { extensionNonMembers.forEach(::addToCompletion) - val availableClasses = implicitScopes.getClassClassLikeSymbols() + val availableClasses = implicitScopes.getClassifierSymbols() availableClasses.forEach(::addToCompletion) } }