diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 12:39:01 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-24 12:39:01 +0100 |
commit | a962349500918a5e26ae9b5567218986838a1ffb (patch) | |
tree | 0a2e6d7c818b4c49b548d20c61aa2807e21a4780 /core/src/main | |
parent | 77a3012145d04ff959de86fb5ec3845cde4b8167 (diff) | |
download | dokka-a962349500918a5e26ae9b5567218986838a1ffb.tar.gz dokka-a962349500918a5e26ae9b5567218986838a1ffb.tar.bz2 dokka-a962349500918a5e26ae9b5567218986838a1ffb.zip |
Support 'dynamic' type
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 12 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/KotlinLanguageService.kt | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 4974b765..d9561980 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -165,6 +165,11 @@ class DocumentationBuilder return appendType(it.abbreviation) } + if (kotlinType.isDynamic()) { + append(DocumentationNode("dynamic", Content.Empty, kind), RefKind.Detail) + return + } + val classifierDescriptor = kotlinType.constructor.declarationDescriptor val name = when (classifierDescriptor) { is ClassDescriptor -> { @@ -361,13 +366,14 @@ class DocumentationBuilder .filter { it.extensionReceiverParameter != null } val extensionFunctionsByName = allExtensionFunctions.groupBy { it.name } - allExtensionFunctions.forEach { extensionFunction -> + for (extensionFunction in allExtensionFunctions) { val possiblyShadowingFunctions = extensionFunctionsByName[extensionFunction.name] ?.filter { fn -> fn.canShadow(extensionFunction) } ?: emptyList() - val classDescriptor = extensionFunction.getExtensionClassDescriptor() ?: return@forEach - val subclasses = classHierarchy[classDescriptor] ?: return@forEach + if (extensionFunction.extensionReceiverParameter?.type?.isDynamic() == true) continue + val classDescriptor = extensionFunction.getExtensionClassDescriptor() ?: continue + val subclasses = classHierarchy[classDescriptor] ?: continue subclasses.forEach { subclass -> if (subclass.isExtensionApplicable(extensionFunction) && possiblyShadowingFunctions.none { subclass.isExtensionApplicable(it) }) { diff --git a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt index faac9f7d..e54772b3 100644 --- a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt +++ b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt @@ -186,6 +186,10 @@ class KotlinLanguageService : LanguageService { } private fun ContentBlock.renderType(node: DocumentationNode, renderMode: RenderMode) { + if (node.name == "dynamic") { + keyword("dynamic") + return + } if (node.isFunctionalType()) { renderFunctionalType(node, renderMode) return |