aboutsummaryrefslogtreecommitdiff
path: root/src/Generation/KotlinSignatureGenerator.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:33:43 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:33:43 +0400
commit433b8965b040c0d4ccb690c08489a9a4a89c4f8b (patch)
tree68430e4e43b1db38c34a359aa09d9d3d4d9d1e6e /src/Generation/KotlinSignatureGenerator.kt
parent65d8e5f6375f50ca691783982e9e5b3e93be5fa7 (diff)
downloaddokka-433b8965b040c0d4ccb690c08489a9a4a89c4f8b.tar.gz
dokka-433b8965b040c0d4ccb690c08489a9a4a89c4f8b.tar.bz2
dokka-433b8965b040c0d4ccb690c08489a9a4a89c4f8b.zip
Add renderName for formatting names of entities in lists, links, etc
Diffstat (limited to 'src/Generation/KotlinSignatureGenerator.kt')
-rw-r--r--src/Generation/KotlinSignatureGenerator.kt20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Generation/KotlinSignatureGenerator.kt b/src/Generation/KotlinSignatureGenerator.kt
index e73dd8d9..6bdf9562 100644
--- a/src/Generation/KotlinSignatureGenerator.kt
+++ b/src/Generation/KotlinSignatureGenerator.kt
@@ -24,6 +24,13 @@ class KotlinSignatureGenerator : SignatureGenerator {
}
}
+ override fun renderName(node: DocumentationNode): String {
+ return when (node.kind) {
+ Kind.Constructor -> node.owner!!.name
+ else -> node.name
+ }
+ }
+
override fun renderPackage(node: DocumentationNode): String {
return "package ${node.name}"
}
@@ -99,9 +106,14 @@ class KotlinSignatureGenerator : SignatureGenerator {
append(node.name)
append(renderTypeParametersForNode(node))
- append("(")
- append(node.details(Kind.Parameter).map { renderParameter(it) }.join())
- append(")")
+ /*
+ val constructors = node.members(Kind.Constructor)
+ if (constructors.count() == 1) {
+ append("(")
+ append(constructors[0].details(Kind.Parameter).map { renderParameter(it) }.join())
+ append(")")
+ }
+ */
}.toString()
}
@@ -109,7 +121,7 @@ class KotlinSignatureGenerator : SignatureGenerator {
return StringBuilder {
append(renderModifiersForNode(node))
when (node.kind) {
- Kind.Constructor -> append("init")
+ Kind.Constructor -> append(node.owner!!.name)
Kind.Function -> append("fun ")
else -> throw IllegalArgumentException("Node $node is not a function-like object")
}