diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2016-04-27 20:44:36 +0200 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2016-04-27 20:44:36 +0200 |
commit | e33ea05d10a35adfe6835dce291080d9843e6b71 (patch) | |
tree | 8a831b0c26d94b86599f41e844f7b3ec57236611 /core/src/main/kotlin/Languages | |
parent | 6ce0bdf71e76a14e6aedd44cb3987185816fc642 (diff) | |
download | dokka-e33ea05d10a35adfe6835dce291080d9843e6b71.tar.gz dokka-e33ea05d10a35adfe6835dce291080d9843e6b71.tar.bz2 dokka-e33ea05d10a35adfe6835dce291080d9843e6b71.zip |
Use FQ name instead of simple name to identify array classes. Resolves #68
Diffstat (limited to 'core/src/main/kotlin/Languages')
-rw-r--r-- | core/src/main/kotlin/Languages/JavaLanguageService.kt | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/core/src/main/kotlin/Languages/JavaLanguageService.kt b/core/src/main/kotlin/Languages/JavaLanguageService.kt index d6f9ade5..f3b567d3 100644 --- a/core/src/main/kotlin/Languages/JavaLanguageService.kt +++ b/core/src/main/kotlin/Languages/JavaLanguageService.kt @@ -43,15 +43,24 @@ class JavaLanguageService : LanguageService { } } - fun getArrayElementType(node: DocumentationNode): DocumentationNode? = when (node.name) { - "Array" -> node.details(NodeKind.Type).singleOrNull()?.let { et -> getArrayElementType(et) ?: et } ?: DocumentationNode("Object", node.content, NodeKind.ExternalClass) - "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> DocumentationNode(node.name.removeSuffix("Array").toLowerCase(), node.content, NodeKind.Type) + fun getArrayElementType(node: DocumentationNode): DocumentationNode? = when (node.qualifiedName()) { + "kotlin.Array" -> + node.details(NodeKind.Type).singleOrNull()?.let { et -> getArrayElementType(et) ?: et } ?: DocumentationNode("Object", node.content, NodeKind.ExternalClass) + + "kotlin.IntArray", "kotlin.LongArray", "kotlin.ShortArray", "kotlin.ByteArray", + "kotlin.CharArray", "kotlin.DoubleArray", "kotlin.FloatArray", "kotlin.BooleanArray" -> + DocumentationNode(node.name.removeSuffix("Array").toLowerCase(), node.content, NodeKind.Type) + else -> null } - fun getArrayDimension(node: DocumentationNode): Int = when (node.name) { - "Array" -> 1 + (node.details(NodeKind.Type).singleOrNull()?.let { getArrayDimension(it) } ?: 0) - "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> 1 + fun getArrayDimension(node: DocumentationNode): Int = when (node.qualifiedName()) { + "kotlin.Array" -> + 1 + (node.details(NodeKind.Type).singleOrNull()?.let { getArrayDimension(it) } ?: 0) + + "kotlin.IntArray", "kotlin.LongArray", "kotlin.ShortArray", "kotlin.ByteArray", + "kotlin.CharArray", "kotlin.DoubleArray", "kotlin.FloatArray", "kotlin.BooleanArray" -> + 1 else -> 0 } |