diff options
Diffstat (limited to 'core/src/main')
3 files changed, 17 insertions, 13 deletions
diff --git a/core/src/main/kotlin/pages/PageBuilder.kt b/core/src/main/kotlin/pages/PageBuilder.kt index df0c12c2..e3105918 100644 --- a/core/src/main/kotlin/pages/PageBuilder.kt +++ b/core/src/main/kotlin/pages/PageBuilder.kt @@ -62,7 +62,7 @@ open class DefaultPageBuilder( } } - fun contentForClasslike(c: Classlike): ContentGroup = when (c) { + open fun contentForClasslike(c: Classlike): ContentGroup = when (c) { is Class -> contentForClass(c) is Enum -> contentForEnum(c) else -> throw IllegalStateException("$c should not be present here") @@ -91,7 +91,7 @@ open class DefaultPageBuilder( text(it.briefDocTagString) } - block("Functions", 2, ContentKind.Functions, c.functions, c.platformData) { + this.block("Functions", 2, ContentKind.Functions, c.functions, c.platformData) { link(it.name, it.dri) signature(it) text(it.briefDocTagString) diff --git a/core/src/main/kotlin/pages/PageContentBuilder.kt b/core/src/main/kotlin/pages/PageContentBuilder.kt index bc01b03e..ed0a0fea 100644 --- a/core/src/main/kotlin/pages/PageContentBuilder.kt +++ b/core/src/main/kotlin/pages/PageContentBuilder.kt @@ -17,7 +17,7 @@ open class DefaultPageContentBuilder( private val styles: Set<Style> = emptySet(), private val extras: Set<Extra> = emptySet() ) : PageContentBuilder { - private val contents = mutableListOf<ContentNode>() + protected val contents = mutableListOf<ContentNode>() protected fun createText(text: String, kind: Kind = ContentKind.Symbol) = ContentText(text, DCI(dri, kind), platformData, styles, extras) diff --git a/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt index 2078faa7..144f319f 100644 --- a/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt +++ b/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt @@ -13,6 +13,8 @@ import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.idea.caches.project.getPlatformModuleInfo +import org.jetbrains.kotlin.platform.TargetPlatform object DefaultPsiToDocumentationTranslator : PsiToDocumentationTranslator { @@ -71,18 +73,20 @@ object DefaultPsiToDocumentationTranslator : PsiToDocumentationTranslator { link(superClass, node, RefKind.Inheritor) } }*/ + val inherited = emptyList<DRI>() //listOf(psi.superClass) + psi.interfaces // TODO DRIs of inherited + val actual = getComment(psi).map { ClassPlatformInfo(it, inherited) } return Class( - dri, - name.orEmpty(), - kind, - constructors.map { parseFunction(it, dri, true) }, - methods.mapNotNull { if (!it.isConstructor) parseFunction(it, dri) else null }, - fields.mapNotNull { parseField(it, dri) }, - innerClasses.map { parseClass(it, dri) }, - null, - emptyList(), - mutableSetOf(), + dri = dri, + name = name.orEmpty(), + kind = kind, + constructors = constructors.map { parseFunction(it, dri, true) }, + functions = methods.mapNotNull { if (!it.isConstructor) parseFunction(it, dri) else null }, + properties = fields.mapNotNull { parseField(it, dri) }, + classlikes = innerClasses.map { parseClass(it, dri) }, + expected = null, + actual = actual, + extra = mutableSetOf(), visibility = mapOf(platformData to psi.getVisibility()) ) } |