diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-09-11 14:13:25 +0200 |
---|---|---|
committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-07 03:12:40 +0200 |
commit | c2b741232c0dbf4e44dbb477b6a11fb836cf0c33 (patch) | |
tree | 83b51e5a5b6628a2612e642d5e551d0fb3da45be /plugins/base/src/main | |
parent | ec637955575995011351b106d3a67194d21c4b15 (diff) | |
download | dokka-c2b741232c0dbf4e44dbb477b6a11fb836cf0c33.tar.gz dokka-c2b741232c0dbf4e44dbb477b6a11fb836cf0c33.tar.bz2 dokka-c2b741232c0dbf4e44dbb477b6a11fb836cf0c33.zip |
Hide derived members that are not public
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index e1ba3cea..fe0c090b 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -388,12 +388,13 @@ private class DokkaDescriptorVisitor( } } - private suspend fun visitPropertyDescriptor(descriptor: PropertyDescriptor, parent: DRIWithPlatformInfo): DProperty { - val dri = parent.dri.copy(callable = Callable.from(descriptor)) + private suspend fun visitPropertyDescriptor(originalDescriptor: PropertyDescriptor, parent: DRIWithPlatformInfo): DProperty { + val dri = parent.dri.copy(callable = Callable.from(originalDescriptor)) + val descriptor = originalDescriptor.getConcreteDescriptor() val isExpect = descriptor.isExpect val isActual = descriptor.isActual - val actual = descriptor.createSources() + val actual = originalDescriptor.createSources() return coroutineScope { val generics = async { descriptor.typeParameters.parallelMap { it.toVariantTypeParameter() } } @@ -435,12 +436,13 @@ private class DokkaDescriptorVisitor( else overriddenDescriptors.first().createDRI(DRI.from(this)) - private suspend fun visitFunctionDescriptor(descriptor: FunctionDescriptor, parent: DRIWithPlatformInfo): DFunction { - val (dri, inheritedFrom) = descriptor.createDRI() + private suspend fun visitFunctionDescriptor(originalDescriptor: FunctionDescriptor, parent: DRIWithPlatformInfo): DFunction { + val (dri, inheritedFrom) = originalDescriptor.createDRI() + val descriptor = originalDescriptor.getConcreteDescriptor() val isExpect = descriptor.isExpect val isActual = descriptor.isActual - val actual = descriptor.createSources() + val actual = originalDescriptor.createSources() return coroutineScope { val generics = async { descriptor.typeParameters.parallelMap { it.toVariantTypeParameter() } } @@ -920,7 +922,11 @@ private class DokkaDescriptorVisitor( } } - private suspend fun ValueParameterDescriptor.getDefaultValue(): String? = + private fun <T : CallableMemberDescriptor> T.getConcreteDescriptor(): T = + if (kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE) this + else overriddenDescriptors.first().getConcreteDescriptor() as T + + private fun ValueParameterDescriptor.getDefaultValue(): String? = (source as? KotlinSourceElement)?.psi?.children?.find { it is KtExpression }?.text private suspend fun PropertyDescriptor.getDefaultValue(): String? = |