diff options
author | Szymon Świstun <sswistun@virtuslab.com> | 2020-02-11 15:57:29 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-02-12 13:13:18 +0100 |
commit | af9697cbd2eb1a26c8a07d191ca6360d416a1666 (patch) | |
tree | dcb910792ba09457e7c52b64115d7215a2fa7d9b /core/src | |
parent | 50e711d24b517bc93c37d89f258c9dafaa038ad1 (diff) | |
download | dokka-af9697cbd2eb1a26c8a07d191ca6360d416a1666.tar.gz dokka-af9697cbd2eb1a26c8a07d191ca6360d416a1666.tar.bz2 dokka-af9697cbd2eb1a26c8a07d191ca6360d416a1666.zip |
kotlin-as-java fixed
Diffstat (limited to 'core/src')
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()) ) } |