aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
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
| [<init>](test/-c/-init-) | `C()` |