From cfdc9f342a66e06b9621f74d942f89b750e632be Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Fri, 27 Jan 2023 21:14:33 +0100 Subject: [PATCH] [AA] KtSymbolInfoProvider: pass missing annotationUseSiteTarget to getDeprecation ^KT-56046 --- .../api/components/KtSymbolInfoProvider.kt | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtSymbolInfoProvider.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtSymbolInfoProvider.kt index d463456f5b4..072e5495f9e 100644 --- a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtSymbolInfoProvider.kt +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtSymbolInfoProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -7,12 +7,12 @@ package org.jetbrains.kotlin.analysis.api.components import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion import org.jetbrains.kotlin.analysis.api.symbols.KtClassOrObjectSymbol -import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo -import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget import org.jetbrains.kotlin.analysis.api.symbols.KtPropertySymbol import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol +import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget import org.jetbrains.kotlin.descriptors.annotations.KotlinTarget import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo public abstract class KtSymbolInfoProvider : KtAnalysisSessionComponent() { public abstract fun getDeprecation(symbol: KtSymbol): DeprecationInfo? @@ -28,22 +28,21 @@ public abstract class KtSymbolInfoProvider : KtAnalysisSessionComponent() { public interface KtSymbolInfoProviderMixIn : KtAnalysisSessionMixIn { /** - * Gets the deprecation status of the given symbol. Returns null if the symbol it not deprecated. + * Gets the deprecation status of the given symbol. Returns null if the symbol is not deprecated. */ - public val KtSymbol.deprecationStatus: DeprecationInfo? get() = withValidityAssertion { - analysisSession.symbolInfoProvider.getDeprecation( - this - ) - } + public val KtSymbol.deprecationStatus: DeprecationInfo? + get() = withValidityAssertion { + analysisSession.symbolInfoProvider.getDeprecation(this) + } /** - * Gets the deprecation status of the given symbol. Returns null if the symbol it not deprecated. + * Gets the deprecation status of the given symbol. Returns null if the symbol is not deprecated. */ public fun KtSymbol.getDeprecationStatus(annotationUseSiteTarget: AnnotationUseSiteTarget?): DeprecationInfo? = - withValidityAssertion { analysisSession.symbolInfoProvider.getDeprecation(this) } + withValidityAssertion { analysisSession.symbolInfoProvider.getDeprecation(this, annotationUseSiteTarget) } /** - * Gets the deprecation status of the getter of this property symbol. Returns null if the getter it not deprecated. + * Gets the deprecation status of the getter of this property symbol. Returns null if the getter is not deprecated. */ public val KtPropertySymbol.getterDeprecationStatus: DeprecationInfo? get() = withValidityAssertion { analysisSession.symbolInfoProvider.getGetterDeprecation(this) } @@ -55,16 +54,15 @@ public interface KtSymbolInfoProviderMixIn : KtAnalysisSessionMixIn { public val KtPropertySymbol.setterDeprecationStatus: DeprecationInfo? get() = withValidityAssertion { analysisSession.symbolInfoProvider.getSetterDeprecation(this) } - public val KtPropertySymbol.javaGetterName: Name get() = withValidityAssertion { - analysisSession.symbolInfoProvider.getJavaGetterName( - this - ) - } - public val KtPropertySymbol.javaSetterName: Name? get() = withValidityAssertion { - analysisSession.symbolInfoProvider.getJavaSetterName( - this - ) - } + public val KtPropertySymbol.javaGetterName: Name + get() = withValidityAssertion { + analysisSession.symbolInfoProvider.getJavaGetterName(this) + } + + public val KtPropertySymbol.javaSetterName: Name? + get() = withValidityAssertion { + analysisSession.symbolInfoProvider.getJavaSetterName(this) + } /** Gets the set of applicable targets for an annotation class symbol. Returns `null` if the symbol is not an annotation class. */ public val KtClassOrObjectSymbol.annotationApplicableTargets: Set?