diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-04-02 18:20:34 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-07 11:43:41 +0200 |
commit | af1ea32aa3f1e71cd47851a4a06344431801c8fd (patch) | |
tree | 906f1d7751780ba82dee91a4dbd7c29c585c52f9 /core/src | |
parent | fe24837fb51d5004ec3d7d728ce4c325a192e426 (diff) | |
download | dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.tar.gz dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.tar.bz2 dokka-af1ea32aa3f1e71cd47851a4a06344431801c8fd.zip |
Add Typealiases rendering and merging
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 5 | ||||
-rw-r--r-- | core/src/main/kotlin/model/aditionalExtras.kt | 18 | ||||
-rw-r--r-- | core/src/main/kotlin/pages/ContentNodes.kt | 5 |
3 files changed, 21 insertions, 7 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 42b49b82..f91383de 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -349,11 +349,12 @@ data class DTypeAlias( override val dri: DRI, override val name: String, override val type: Bound, - val underlyingType: Bound, + val underlyingType: PlatformDependent<Bound>, + override val visibility: PlatformDependent<Visibility>, override val documentation: PlatformDependent<DocumentationNode>, override val platformData: List<PlatformData>, override val extra: PropertyContainer<DTypeAlias> = PropertyContainer.empty() -) : Documentable(), WithType, WithExtraProperties<DTypeAlias> { +) : Documentable(), WithType, WithVisibility, WithExtraProperties<DTypeAlias> { override val children: List<Nothing> get() = emptyList() diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index af399745..58209939 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -28,8 +28,8 @@ class Annotations(val content: List<Annotation>) : ExtraProperty<Documentable> { override val key: ExtraProperty.Key<Documentable, *> = Annotations data class Annotation(val dri: DRI, val params: Map<String, String>) { - override fun equals(other: Any?): Boolean = when(other) { - is Annotation -> dri.equals(other.dri) + override fun equals(other: Any?): Boolean = when (other) { + is Annotation -> dri == other.dri else -> false } @@ -37,6 +37,18 @@ class Annotations(val content: List<Annotation>) : ExtraProperty<Documentable> { } } -object PrimaryConstructorExtra: ExtraProperty<DFunction>, ExtraProperty.Key<DFunction, PrimaryConstructorExtra> { +object PrimaryConstructorExtra : ExtraProperty<DFunction>, ExtraProperty.Key<DFunction, PrimaryConstructorExtra> { override val key: ExtraProperty.Key<DFunction, *> = this +} + +data class ActualTypealias(val underlyingType: PlatformDependent<Bound>) : ExtraProperty<DClasslike> { + companion object : ExtraProperty.Key<DClasslike, ActualTypealias> { + override fun mergeStrategyFor( + left: ActualTypealias, + right: ActualTypealias + ) = + MergeStrategy.Replace(ActualTypealias(PlatformDependent(left.underlyingType + right.underlyingType))) + } + + override val key: ExtraProperty.Key<DClasslike, ActualTypealias> = ActualTypealias }
\ No newline at end of file diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index c1792759..61bc3dfc 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -167,10 +167,11 @@ interface Style interface Kind enum class ContentKind : Kind { - Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, Empty; + Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, + Empty, TypeAliases; companion object{ - private val platformTagged = setOf(Constructors, Functions, Properties, Classlikes, Packages) + private val platformTagged = setOf(Constructors, Functions, Properties, Classlikes, Packages, TypeAliases) fun shouldBePlatformTagged(kind: Kind) : Boolean = kind in platformTagged } |