diff options
8 files changed, 15 insertions, 14 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 337bddc5..67a8beef 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -184,7 +184,7 @@ data class Enum( data class EnumEntry( override val dri: DRI, - override val name: String?, + override val name: String, override val documentation: PlatformDependent<DocumentationNode>, override val functions: List<Function>, override val properties: List<Property>, @@ -221,7 +221,7 @@ data class Function( data class Interface( override val dri: DRI, - override val name: String?, + override val name: String, override val documentation: PlatformDependent<DocumentationNode>, override val actual: PlatformDependent<DocumentableSource>, override val functions: List<Function>, @@ -260,7 +260,7 @@ data class Object( } data class Annotation( - override val name: String?, + override val name: String, override val dri: DRI, override val documentation: PlatformDependent<DocumentationNode>, override val actual: PlatformDependent<DocumentableSource>, diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index 485aca4c..64363078 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -115,7 +115,7 @@ fun Property.mergeWith(other: Property): Property = copy( actual = actual.mergeWith(other.actual), visibility = visibility.mergeWith(other.visibility), platformData = (platformData + other.platformData).distinct(), - getter = getter.mergeWith(other.getter), + getter = getter?.let { g -> other.getter?.let { g.mergeWith(it) } ?: g } ?: other.getter, setter = setter?.let { s -> other.setter?.let { s.mergeWith(it) } ?: s } ?: other.setter ).mergeExtras(this, other) diff --git a/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt index da06e621..1001ffb3 100644 --- a/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt @@ -238,7 +238,6 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { private fun PsiModifierListOwner.getModifier() = when { hasModifier(JvmModifier.ABSTRACT) -> WithAbstraction.Modifier.Abstract - hasModifier(JvmModifier.STATIC) -> WithAbstraction.Modifier.Static hasModifier(JvmModifier.FINAL) -> WithAbstraction.Modifier.Final else -> null } diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 2cd0eca8..895690c2 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -32,7 +32,7 @@ class DefaultDescriptorToDocumentableTranslator( moduleName: String, packageFragments: Iterable<PackageFragmentDescriptor>, platformData: PlatformData - ) = DokkaDescriptorVisitor(platformData, context.platforms[platformData]?.facade!!).run { + ) = DokkaDescriptorVisitor(platformData, context.platforms.getValue(platformData).facade).run { packageFragments.map { visitPackageFragmentDescriptor( it, diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 03a28ceb..4da35099 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -74,7 +74,7 @@ open class DefaultPageCreator( protected open fun contentForClasslike(c: Classlike) = contentBuilder.contentFor(c) { when (c) { // TODO this when will be removed when signature generation is moved to utils - is Class -> header(1) { text(c.name) } + is Class, is Object, is Annotation, is Interface -> header(1) { text(c.name ?: "<>") } is Enum -> { header(1) { text("enum ${c.name}") } block("Entries", 2, ContentKind.Properties, c.entries, c.platformData.toSet()) { entry -> @@ -124,3 +124,7 @@ open class DefaultPageCreator( protected open fun TagWrapper.toHeaderString() = this.javaClass.toGenericString().split('.').last() } + +class A { + companion object F {} +}
\ No newline at end of file diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index c58c4e30..5099c46f 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -27,9 +27,8 @@ open class KDocTest : AbstractCoreTest() { private fun actualDocumentationNode(modulePageNode: ModulePageNode) = (modulePageNode.documentable?.children?.first() as Package) - .classlikes.first() - .platformInfo.first() - .documentationNode + .classlikes.single() + .documentation.values.single() protected fun executeTest(kdoc: String, expectedDocumentationNode: DocumentationNode) { diff --git a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt index f9431bbb..ae5b4e06 100644 --- a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt +++ b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt @@ -47,8 +47,7 @@ class BasicMultiplatformTest : AbstractCoreTest() { configuration ) { pagesGenerationStage = { - println(it.dri) - assertEquals(7, it.parentMap.size) + assertEquals(6, it.parentMap.size) } } } diff --git a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt index cded0929..1d62fd17 100644 --- a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt +++ b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt @@ -25,8 +25,8 @@ object MathjaxTransformer : PageTransformer { } private val ContentPage.isNeedingMathjax - get() = documentable?.platformInfo - ?.flatMap { it.documentationNode.children } + get() = documentable?.documentation?.values + ?.flatMap { it.children } .orEmpty() .any { (it as? CustomWrapperTag)?.name == ANNOTATION } }
\ No newline at end of file |