diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-09-21 20:42:24 +0200 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-09-21 20:42:24 +0200 |
commit | 40c7daf254f40bcf830825da6e067908b01f1507 (patch) | |
tree | 4dd4319a75c3ed64dfeee41af871a77e9106a37a /src/Kotlin/KotlinLanguageService.kt | |
parent | 8d5e09a1b983be7f82b5c583ab99392669efc3f7 (diff) | |
download | dokka-40c7daf254f40bcf830825da6e067908b01f1507.tar.gz dokka-40c7daf254f40bcf830825da6e067908b01f1507.tar.bz2 dokka-40c7daf254f40bcf830825da6e067908b01f1507.zip |
fix rendering of extension function types
Diffstat (limited to 'src/Kotlin/KotlinLanguageService.kt')
-rw-r--r-- | src/Kotlin/KotlinLanguageService.kt | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index bd98579a..6541e46c 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -76,26 +76,17 @@ class KotlinLanguageService : LanguageService { } private fun ContentBlock.renderType(node: DocumentationNode) { - val typeArguments = node.details(DocumentationNode.Kind.Type) + var typeArguments = node.details(DocumentationNode.Kind.Type) if (node.name == "Function${typeArguments.count() - 1}") { // lambda - symbol("(") - renderList(typeArguments.take(typeArguments.size() - 1), noWrap = true) { - renderType(it) + val isExtension = node.annotations.any { it.name == "Extension" } + if (isExtension) { + renderType(typeArguments.first()) + symbol(".") + typeArguments = typeArguments.drop(1) } - symbol(")") - nbsp() - symbol("->") - nbsp() - renderType(typeArguments.last()) - return - } - if (node.name == "ExtensionFunction${typeArguments.count() - 2}") { - // extension lambda - renderType(typeArguments.first()) - symbol(".") symbol("(") - renderList(typeArguments.drop(1).take(typeArguments.size() - 2), noWrap = true) { + renderList(typeArguments.take(typeArguments.size() - 1), noWrap = true) { renderType(it) } symbol(")") |