diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-12-03 12:39:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 12:39:39 +0100 |
commit | 6b383541d110ba4f32c9c9ae6c0af8aeeedd0b80 (patch) | |
tree | 57963d77754ab2b0de7eb5abe74b0c1ffd9fc825 /plugins/base/src/main/kotlin/translators | |
parent | 80d8991fc572bd145e873ae368dca0b201e069cf (diff) | |
download | dokka-6b383541d110ba4f32c9c9ae6c0af8aeeedd0b80.tar.gz dokka-6b383541d110ba4f32c9c9ae6c0af8aeeedd0b80.tar.bz2 dokka-6b383541d110ba4f32c9c9ae6c0af8aeeedd0b80.zip |
Resolve DRI-s from valueOf and values in java enum (#1655)
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 61af1db1..9a1b05d5 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -199,7 +199,7 @@ class DefaultPsiToDocumentableTranslator( parseSupertypes(superTypes) val (regularFunctions, accessors) = splitFunctionsAndAccessors() val documentation = javadocParser.parseDocumentation(this).toSourceSetDependent() - val allFunctions = async { regularFunctions.parallelMapNotNull { if (!it.isConstructor) parseFunction(it) else null } + + val allFunctions = async { regularFunctions.parallelMapNotNull { if (!it.isConstructor) parseFunction(it, parentDRI = dri) else null } + superMethods.parallelMap { parseFunction(it.first, inheritedFrom = it.second) } } val source = PsiDocumentableSource(this).toSourceSetDependent() val classlikes = async { innerClasses.asIterable().parallelMap { parseClasslike(it, dri) } } @@ -337,9 +337,12 @@ class DefaultPsiToDocumentableTranslator( private fun parseFunction( psi: PsiMethod, isConstructor: Boolean = false, - inheritedFrom: DRI? = null + inheritedFrom: DRI? = null, + parentDRI: DRI? = null ): DFunction { - val dri = DRI.from(psi) + val dri = parentDRI?.let { dri -> + DRI.from(psi).copy(packageName = dri.packageName, classNames = dri.classNames) + } ?: DRI.from(psi) val docs = javadocParser.parseDocumentation(psi) return DFunction( dri, |