[AA] KT-56617 Introduce PSI-based Java type parameter symbols

- Instead of extending the API with `typeParameterNames`, this commit
  creates a PSI-based Java type parameter symbol similarly to the
  PSI-based Java class symbol. Because completion requires only the type
  parameter name, this approach works fine, and without exposing an
  optimization via the API.
This commit is contained in:
Marco Pennekamp
2023-03-06 22:18:04 +01:00
committed by Space Team
parent 1e43e8d975
commit 037984b0e0
5 changed files with 115 additions and 63 deletions
@@ -5,7 +5,6 @@
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.name.Name
@@ -20,11 +19,4 @@ 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 } }
}