aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-04-03 12:45:54 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-04-07 11:43:41 +0200
commitfe24837fb51d5004ec3d7d728ce4c325a192e426 (patch)
treeec8a3548d06036fa042ff52447eb35d22497d0ee /core/src/main
parent828b20f1d7ba7e84f34452452ffa395638a72f2e (diff)
downloaddokka-fe24837fb51d5004ec3d7d728ce4c325a192e426.tar.gz
dokka-fe24837fb51d5004ec3d7d728ce4c325a192e426.tar.bz2
dokka-fe24837fb51d5004ec3d7d728ce4c325a192e426.zip
Add DTypeAlias documentable
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/links/DRI.kt4
-rw-r--r--core/src/main/kotlin/model/Documentable.kt16
2 files changed, 19 insertions, 1 deletions
diff --git a/core/src/main/kotlin/links/DRI.kt b/core/src/main/kotlin/links/DRI.kt
index abc88939..f961c982 100644
--- a/core/src/main/kotlin/links/DRI.kt
+++ b/core/src/main/kotlin/links/DRI.kt
@@ -33,7 +33,9 @@ data class DRI(
val params = callable?.let { listOfNotNull(it.extensionReceiverParameter) + it.valueParameters }.orEmpty()
DRI(
firstIsInstanceOrNull<PackageFragmentDescriptor>()?.fqName?.asString(),
- filterIsInstance<ClassDescriptor>().toList().takeIf { it.isNotEmpty() }?.asReversed()
+ (filterIsInstance<ClassDescriptor>() + filterIsInstance<TypeAliasDescriptor>()).toList()
+ .takeIf { it.isNotEmpty() }
+ ?.asReversed()
?.joinToString(separator = ".") { it.name.asString() },
callable?.let { Callable.from(it) },
firstIsInstanceOrNull<ParameterDescriptor>()?.let { params.indexOf(it) },
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index fec94537..42b49b82 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -140,6 +140,7 @@ data class DPackage(
override val functions: List<DFunction>,
override val properties: List<DProperty>,
override val classlikes: List<DClasslike>,
+ val typealiases: List<DTypeAlias>,
override val documentation: PlatformDependent<DocumentationNode>,
override val platformData: List<PlatformData>,
override val extra: PropertyContainer<DPackage> = PropertyContainer.empty()
@@ -344,6 +345,21 @@ data class DTypeParameter(
override fun withNewExtras(newExtras: PropertyContainer<DTypeParameter>) = copy(extra = newExtras)
}
+data class DTypeAlias(
+ override val dri: DRI,
+ override val name: String,
+ override val type: Bound,
+ val underlyingType: Bound,
+ override val documentation: PlatformDependent<DocumentationNode>,
+ override val platformData: List<PlatformData>,
+ override val extra: PropertyContainer<DTypeAlias> = PropertyContainer.empty()
+) : Documentable(), WithType, WithExtraProperties<DTypeAlias> {
+ override val children: List<Nothing>
+ get() = emptyList()
+
+ override fun withNewExtras(newExtras: PropertyContainer<DTypeAlias>) = copy(extra = newExtras)
+}
+
sealed class Projection
sealed class Bound : Projection()
data class OtherParameter(val name: String) : Bound()