[AA] support @JvmField in KtSymbolInfoProvider

^KT-54311
^KT-54360 Fixed
This commit is contained in:
Dmitrii Gridin
2022-10-07 17:01:34 +02:00
committed by Space Team
parent f4ae696aee
commit 01d5a5bc5b
13 changed files with 284 additions and 21 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo
import org.jetbrains.kotlin.resolve.deprecation.DeprecationLevelValue
import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver
import org.jetbrains.kotlin.resolve.deprecation.SimpleDeprecationInfo
import org.jetbrains.kotlin.resolve.jvm.annotations.hasJvmFieldAnnotation
import org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor
@@ -101,6 +102,8 @@ internal class KtFe10SymbolInfoProvider(
}
if (descriptor != null) {
if (descriptor.hasJvmFieldAnnotation()) return descriptor.name
val getter = descriptor.getter ?: return SpecialNames.NO_NAME_PROVIDED
return Name.identifier(DescriptorUtils.getJvmName(getter) ?: JvmAbi.getterName(descriptor.name.asString()))
}
@@ -120,6 +123,8 @@ internal class KtFe10SymbolInfoProvider(
return null
}
if (descriptor.hasJvmFieldAnnotation()) return descriptor.name
val setter = descriptor.setter ?: return SpecialNames.NO_NAME_PROVIDED
return Name.identifier(DescriptorUtils.getJvmName(setter) ?: JvmAbi.setterName(descriptor.name.asString()))
}
@@ -184,6 +184,12 @@ public class Fe10IdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated extends A
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturnInLambda.kt");
}
@Test
@TestMetadata("jvmField.kt")
public void testJvmField() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/jvmField.kt");
}
@Test
@TestMetadata("jvmName.kt")
public void testJvmName() throws Exception {