aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-21 17:18:25 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-21 17:19:49 +0300
commitb6d79cf83917e6a8c843209df3ffa7d9e54d0917 (patch)
tree56144d5067445f72eb4c13264e1b8942c0738adf /core
parentafea8e9e9c4b88af8c7eb7fc2d993d2eca29c4a1 (diff)
downloaddokka-b6d79cf83917e6a8c843209df3ffa7d9e54d0917.tar.gz
dokka-b6d79cf83917e6a8c843209df3ffa7d9e54d0917.tar.bz2
dokka-b6d79cf83917e6a8c843209df3ffa7d9e54d0917.zip
Do not suppress Companions when it's extends/implements something
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt8
-rw-r--r--core/testdata/format/inheritedCompanionObjectProperties.md4
2 files changed, 9 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index 856127d3..24840a9d 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -20,9 +20,7 @@ import org.jetbrains.kotlin.psi.KtModifierListOwner
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.constants.ConstantValue
-import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
-import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
-import org.jetbrains.kotlin.resolve.descriptorUtil.isDocumentedAnnotation
+import org.jetbrains.kotlin.resolve.descriptorUtil.*
import org.jetbrains.kotlin.resolve.findTopMostOverriddenDescriptors
import org.jetbrains.kotlin.resolve.jvm.JavaDescriptorResolver
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
@@ -576,6 +574,10 @@ class DocumentationBuilder
descriptorsToDocument.mapTo(result) {
ClassMember(it, inheritedLinkKind = RefKind.InheritedCompanionObjectMember)
}
+
+ if (companionObjectDescriptor.getAllSuperclassesWithoutAny().isNotEmpty()) {
+ result += ClassMember(companionObjectDescriptor)
+ }
}
return result
}
diff --git a/core/testdata/format/inheritedCompanionObjectProperties.md b/core/testdata/format/inheritedCompanionObjectProperties.md
index b3b3230e..db764ff0 100644
--- a/core/testdata/format/inheritedCompanionObjectProperties.md
+++ b/core/testdata/format/inheritedCompanionObjectProperties.md
@@ -4,6 +4,10 @@
`class C : `[`A`](test/-a/index)
+### Types
+
+| [Companion](test/-c/-companion/index) | `companion object Companion : `[`B`](test/-b/index) |
+
### Constructors
| [&lt;init&gt;](test/-c/-init-) | `C()` |