[AA] KT-56617 Optimize type parameter access for Java class symbols
- Completion accesses symbol type parameters to render their names. Instead of building the whole list of type parameters, and consequently the whole FIR class, completion can now access the type parameter names directly.
This commit is contained in:
committed by
Space Team
parent
77e374db77
commit
d5933f28ab
+8
-1
@@ -5,9 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.symbols.markers
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.types.KtType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
public interface KtPossiblyNamedSymbol : KtSymbol {
|
||||
@@ -20,4 +20,11 @@ public interface KtNamedSymbol : KtPossiblyNamedSymbol {
|
||||
|
||||
public interface KtSymbolWithTypeParameters : KtSymbol {
|
||||
public val typeParameters: List<KtTypeParameterSymbol>
|
||||
|
||||
/**
|
||||
* The names of [typeParameters]. Using this property should be preferred if only the names of type parameters are needed, because some
|
||||
* symbol implementations may avoid building the full list of type parameters.
|
||||
*/
|
||||
public val typeParameterNames: List<Name>
|
||||
get() = withValidityAssertion { typeParameters.map { it.name } }
|
||||
}
|
||||
Reference in New Issue
Block a user