[Analysis API] KtPsiTypeProvider: drop asPsiTypeElement method
This was an implementation detail of SLC. In the case, if we want to have proper parents for type annotations in light classes, we have to properly implement `PsiTypeElement` for required declarations. ^KT-66603 ^KT-56870
This commit is contained in:
committed by
Space Team
parent
2fbde7a85c
commit
e1bf85f790
+7
-21
@@ -40,14 +40,15 @@ internal class KtFe10PsiTypeProvider(
|
||||
|
||||
private val typeMapper by lazy { KtFe10JvmTypeMapperContext(analysisContext.resolveSession) }
|
||||
|
||||
override fun asPsiTypeElement(
|
||||
override fun asPsiType(
|
||||
type: KtType,
|
||||
useSitePosition: PsiElement,
|
||||
allowErrorTypes: Boolean,
|
||||
mode: KtTypeMappingMode,
|
||||
isAnnotationMethod: Boolean,
|
||||
suppressWildcards: Boolean?,
|
||||
allowErrorTypes: Boolean,
|
||||
): PsiTypeElement? {
|
||||
preserveAnnotations: Boolean
|
||||
): PsiType? {
|
||||
val kotlinType = (type as KtFe10Type).fe10Type
|
||||
|
||||
with(typeMapper.typeContext) {
|
||||
@@ -58,29 +59,14 @@ internal class KtFe10PsiTypeProvider(
|
||||
|
||||
if (!analysisSession.useSiteModule.platform.has<JvmPlatform>()) return null
|
||||
|
||||
return asPsiTypeElement(
|
||||
val typeElement = asPsiTypeElement(
|
||||
simplifyType(kotlinType),
|
||||
useSitePosition,
|
||||
mode.toTypeMappingMode(type, isAnnotationMethod, suppressWildcards),
|
||||
)
|
||||
}
|
||||
|
||||
override fun asPsiType(
|
||||
type: KtType,
|
||||
useSitePosition: PsiElement,
|
||||
allowErrorTypes: Boolean,
|
||||
mode: KtTypeMappingMode,
|
||||
isAnnotationMethod: Boolean,
|
||||
suppressWildcards: Boolean?,
|
||||
preserveAnnotations: Boolean
|
||||
): PsiType? = asPsiTypeElement(
|
||||
type = type,
|
||||
useSitePosition = useSitePosition,
|
||||
mode = mode,
|
||||
isAnnotationMethod = isAnnotationMethod,
|
||||
suppressWildcards = suppressWildcards,
|
||||
allowErrorTypes = allowErrorTypes,
|
||||
)?.type
|
||||
return typeElement?.type
|
||||
}
|
||||
|
||||
private fun KtTypeMappingMode.toTypeMappingMode(
|
||||
type: KtType,
|
||||
|
||||
Reference in New Issue
Block a user