diff options
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index f64eb261..500b0728 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -112,9 +112,6 @@ class DefaultPsiToDocumentableTranslator( private val PsiClassType.shouldBeIgnored: Boolean get() = isClass("java.lang.Enum") || isClass("java.lang.Object") - private val DRI.isObvious: Boolean - get() = packageName == "java.lang" && (classNames == "Object" || classNames == "Enum") - private fun PsiClassType.isClass(qName: String): Boolean { val shortName = qName.substringAfterLast('.') if (className == shortName) { @@ -446,7 +443,7 @@ class DefaultPsiToDocumentableTranslator( (psi.annotations.toList() .toListOfAnnotations() + it.toListOfAnnotations()).toSourceSetDependent() .toAnnotations(), - ObviousMember.takeIf { inheritedFrom != null && inheritedFrom.isObvious }, + ObviousMember.takeIf { psi.isObvious(inheritedFrom) }, psi.throwsList.toDriList().takeIf { it.isNotEmpty() } ?.let { CheckedExceptions(it.toSourceSetDependent()) } ) @@ -454,6 +451,14 @@ class DefaultPsiToDocumentableTranslator( ) } + private fun PsiMethod.isObvious(inheritedFrom: DRI? = null): Boolean { + return this is SyntheticElement || inheritedFrom?.isObvious() == true + } + + private fun DRI.isObvious(): Boolean { + return packageName == "java.lang" && (classNames == "Object" || classNames == "Enum") + } + private fun PsiReferenceList.toDriList() = referenceElements.mapNotNull { it?.resolve()?.let { DRI.from(it) } } private fun PsiModifierListOwner.additionalExtras() = listOfNotNull( |