diff options
Diffstat (limited to 'plugins/base/src')
3 files changed, 7 insertions, 9 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 18a1dc3c..f3102b2d 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -421,7 +421,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { private fun PsiAnnotationMemberValue.toValue(): AnnotationParameterValue? = when (this) { is PsiAnnotation -> toAnnotation()?.let { AnnotationValue(it) } is PsiArrayInitializerMemberValue -> ArrayValue(initializers.mapNotNull { it.toValue() }) - is PsiReferenceExpression -> driOfReference()?.let { EnumValue(text ?: "", DRI.from(it)) } + is PsiReferenceExpression -> psiReference?.let { EnumValue(text ?: "", DRI.from(it)) } is PsiClassObjectAccessExpression -> ClassValue( text ?: "", DRI.from(((type as PsiImmediateClassType).parameters.single() as PsiClassReferenceType).resolve()!!) @@ -429,7 +429,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { else -> StringValue(text ?: "") } - private fun PsiAnnotation.toAnnotation() = driOfReference()?.let { + private fun PsiAnnotation.toAnnotation() = psiReference?.let { Annotations.Annotation( DRI.from(it), attributes.filter { it !is KtLightAbstractAnnotation }.mapNotNull { it.attributeName to it.toValue() } @@ -440,7 +440,8 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { ) } - private fun PsiElement.driOfReference() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve() + private val PsiElement.psiReference + get() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve() } private data class Ancestor(val dri: DRI, val isInterface: Boolean) diff --git a/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt index b5150ed1..68751ee5 100644 --- a/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt @@ -18,7 +18,6 @@ class DepredatedAndSinceKotlinTest : AbstractCoreTest() { pass { sourceRoots = listOf("src/") analysisPlatform = "jvm" - targets = listOf("jvm") } } } diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index 695a8fd2..f338a8b3 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -126,7 +126,7 @@ class EnumsTest : AbstractCoreTest() { val entryPage = module.dfs { it.name == "E1" } as ClasslikePageNode val signaturePart = (entryPage.content.dfs { it is ContentGroup && it.dci.toString() == "[enums/Test.E1///PointingToDeclaration/][Symbol]" - } as ContentGroup).children.first() as ContentGroup + } as ContentGroup) assertEquals("(\"e1\", 1, true)", signaturePart.constructorSignature()) } } @@ -213,10 +213,8 @@ class EnumsTest : AbstractCoreTest() { } } group { - group { - link { +"E1" } - +"()" - } + link { +"E1" } + +"()" } } } |