Rename Deprecation to DeprecationInfo
This commit is contained in:
+9
-9
@@ -5,40 +5,40 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.frontend.api.components
|
||||
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtPropertySymbol
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSymbol
|
||||
|
||||
public abstract class KtSymbolInfoProvider : KtAnalysisSessionComponent() {
|
||||
public abstract fun getDeprecation(symbol: KtSymbol): Deprecation?
|
||||
public abstract fun getDeprecation(symbol: KtSymbol, annotationUseSiteTarget: AnnotationUseSiteTarget?): Deprecation?
|
||||
public abstract fun getGetterDeprecation(symbol: KtPropertySymbol): Deprecation?
|
||||
public abstract fun getSetterDeprecation(symbol: KtPropertySymbol): Deprecation?
|
||||
public abstract fun getDeprecation(symbol: KtSymbol): DeprecationInfo?
|
||||
public abstract fun getDeprecation(symbol: KtSymbol, annotationUseSiteTarget: AnnotationUseSiteTarget?): DeprecationInfo?
|
||||
public abstract fun getGetterDeprecation(symbol: KtPropertySymbol): DeprecationInfo?
|
||||
public abstract fun getSetterDeprecation(symbol: KtPropertySymbol): DeprecationInfo?
|
||||
}
|
||||
|
||||
public interface KtSymbolInfoProviderMixIn : KtAnalysisSessionMixIn {
|
||||
/**
|
||||
* Gets the deprecation status of the given symbol. Returns null if the symbol it not deprecated.
|
||||
*/
|
||||
public val KtSymbol.deprecationStatus: Deprecation? get() = analysisSession.symbolInfoProvider.getDeprecation(this)
|
||||
public val KtSymbol.deprecationStatus: DeprecationInfo? get() = analysisSession.symbolInfoProvider.getDeprecation(this)
|
||||
|
||||
/**
|
||||
* Gets the deprecation status of the given symbol. Returns null if the symbol it not deprecated.
|
||||
*/
|
||||
public fun KtSymbol.getDeprecationStatus(annotationUseSiteTarget: AnnotationUseSiteTarget?): Deprecation? =
|
||||
public fun KtSymbol.getDeprecationStatus(annotationUseSiteTarget: AnnotationUseSiteTarget?): DeprecationInfo? =
|
||||
analysisSession.symbolInfoProvider.getDeprecation(this)
|
||||
|
||||
/**
|
||||
* Gets the deprecation status of the getter of this property symbol. Returns null if the getter it not deprecated.
|
||||
*/
|
||||
public val KtPropertySymbol.getterDeprecationStatus: Deprecation?
|
||||
public val KtPropertySymbol.getterDeprecationStatus: DeprecationInfo?
|
||||
get() = analysisSession.symbolInfoProvider.getGetterDeprecation(this)
|
||||
|
||||
/**
|
||||
* Gets the deprecation status of the setter of this property symbol. Returns null if the setter it not deprecated or the property does
|
||||
* not have a setter.
|
||||
*/
|
||||
public val KtPropertySymbol.setterDeprecationStatus: Deprecation?
|
||||
public val KtPropertySymbol.setterDeprecationStatus: DeprecationInfo?
|
||||
get() = analysisSession.symbolInfoProvider.getSetterDeprecation(this)
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.frontend.api.symbols
|
||||
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.idea.frontend.api.components.KtSymbolInfoProviderMixIn
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.markers.*
|
||||
@@ -103,7 +103,7 @@ public object DebugSymbolRenderer {
|
||||
append(INDENT, "psi: ${renderValue(value.psi)}")
|
||||
}
|
||||
is KtTypeAndAnnotations -> "${renderValue(value.annotations)} ${renderValue(value.type)}"
|
||||
is Deprecation -> value.toString()
|
||||
is DeprecationInfo -> value.toString()
|
||||
else -> value::class.simpleName!!
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import kotlin.reflect.KClass
|
||||
@@ -337,7 +337,7 @@ private object FirToKtConversionCreator {
|
||||
FqName::class,
|
||||
FirModuleData::class,
|
||||
ExpectActualCompatibility.Incompatible::class,
|
||||
Deprecation::class,
|
||||
DeprecationInfo::class,
|
||||
)
|
||||
|
||||
private val KType.kClass: KClass<*>
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.frontend.api.fir.components
|
||||
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.fir.declarations.getDeprecationForCallSite
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
||||
@@ -22,7 +22,7 @@ internal class KtFirSymbolInfoProvider(
|
||||
override val analysisSession: KtFirAnalysisSession,
|
||||
override val token: ValidityToken,
|
||||
) : KtSymbolInfoProvider(), KtFirAnalysisSessionComponent {
|
||||
override fun getDeprecation(symbol: KtSymbol): Deprecation? {
|
||||
override fun getDeprecation(symbol: KtSymbol): DeprecationInfo? {
|
||||
if (symbol is KtFirBackingFieldSymbol || symbol is KtFirPackageSymbol) return null
|
||||
require(symbol is KtFirSymbol<*>)
|
||||
return symbol.firRef.withFir {
|
||||
@@ -35,7 +35,7 @@ internal class KtFirSymbolInfoProvider(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getDeprecation(symbol: KtSymbol, annotationUseSiteTarget: AnnotationUseSiteTarget?): Deprecation? {
|
||||
override fun getDeprecation(symbol: KtSymbol, annotationUseSiteTarget: AnnotationUseSiteTarget?): DeprecationInfo? {
|
||||
require(symbol is KtFirSymbol<*>)
|
||||
return symbol.firRef.withFir { firDeclaration ->
|
||||
if (annotationUseSiteTarget != null) {
|
||||
@@ -46,14 +46,14 @@ internal class KtFirSymbolInfoProvider(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getGetterDeprecation(symbol: KtPropertySymbol): Deprecation? {
|
||||
override fun getGetterDeprecation(symbol: KtPropertySymbol): DeprecationInfo? {
|
||||
require(symbol is KtFirSymbol<*>)
|
||||
return symbol.firRef.withFir {
|
||||
it.symbol.getDeprecationForCallSite(AnnotationUseSiteTarget.PROPERTY_GETTER, AnnotationUseSiteTarget.PROPERTY)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getSetterDeprecation(symbol: KtPropertySymbol): Deprecation? {
|
||||
override fun getSetterDeprecation(symbol: KtPropertySymbol): DeprecationInfo? {
|
||||
require(symbol is KtFirSymbol<*>)
|
||||
return symbol.firRef.withFir {
|
||||
it.symbol.getDeprecationForCallSite(AnnotationUseSiteTarget.PROPERTY_SETTER, AnnotationUseSiteTarget.PROPERTY)
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ import org.jetbrains.kotlin.psi.KtWhenCondition
|
||||
import org.jetbrains.kotlin.psi.KtWhenEntry
|
||||
import org.jetbrains.kotlin.psi.KtWhenExpression
|
||||
import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility.Incompatible
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
@@ -552,7 +552,7 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract class OverrideDeprecation : KtFirDiagnostic<KtNamedDeclaration>() {
|
||||
override val diagnosticClass get() = OverrideDeprecation::class
|
||||
abstract val overridenSymbol: KtSymbol
|
||||
abstract val deprecationInfo: org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
abstract val deprecationInfo: DeprecationInfo
|
||||
}
|
||||
|
||||
abstract class AnnotationOnSuperclassError : KtFirDiagnostic<KtAnnotationEntry>() {
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ import org.jetbrains.kotlin.psi.KtWhenCondition
|
||||
import org.jetbrains.kotlin.psi.KtWhenEntry
|
||||
import org.jetbrains.kotlin.psi.KtWhenExpression
|
||||
import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import org.jetbrains.kotlin.resolve.deprecation.Deprecation
|
||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
|
||||
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility.Incompatible
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
@@ -879,7 +879,7 @@ internal class DeprecatedSinceKotlinOutsideKotlinSubpackageImpl(
|
||||
|
||||
internal class OverrideDeprecationImpl(
|
||||
override val overridenSymbol: KtSymbol,
|
||||
override val deprecationInfo: org.jetbrains.kotlin.resolve.deprecation.Deprecation,
|
||||
override val deprecationInfo: DeprecationInfo,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.OverrideDeprecation(), KtAbstractFirDiagnostic<KtNamedDeclaration> {
|
||||
|
||||
Reference in New Issue
Block a user