[Analysis API] reuse PsiClassRenderer for PsiType render

To align the format with light classes as now we are powered by them

^KT-66603
This commit is contained in:
Dmitrii Gridin
2024-03-15 20:02:54 +01:00
committed by Space Team
parent 54aee57fec
commit 2fbde7a85c
13 changed files with 17 additions and 12 deletions
@@ -13,6 +13,7 @@ import com.intellij.psi.PsiType
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.asJava.KotlinAsJavaSupport
import org.jetbrains.kotlin.asJava.PsiClassRenderer
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.psi.KtClassOrObject
@@ -26,7 +27,7 @@ object AnalysisApiPsiTypeProviderTestUtils {
context(KtAnalysisSession)
fun render(type: KtType?, variance: Variance = Variance.INVARIANT): String? = type?.render(position = variance)
fun render(type: PsiType?): String? = type?.getCanonicalText(/* annotated = */ true)
fun render(type: PsiType?): String? = type?.let(PsiClassRenderer::renderType)
internal fun getContainingKtLightClass(
declaration: KtDeclaration,