aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-14 19:53:13 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-14 19:53:13 +0400
commit4907736abf96bf04b8e23a6772f0411936cb2008 (patch)
treee9194669ddd74ca5978dfbac9120832652f5fb89 /src/Kotlin/DocumentationBuilder.kt
parent92b82525ebb969cbd0706a6322ec7bace4628800 (diff)
downloaddokka-4907736abf96bf04b8e23a6772f0411936cb2008.tar.gz
dokka-4907736abf96bf04b8e23a6772f0411936cb2008.tar.bz2
dokka-4907736abf96bf04b8e23a6772f0411936cb2008.zip
Sort members into groups, filter accessors
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 875048e5..c3f8ca57 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -139,10 +139,9 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
is ClassDescriptor -> build()
is ConstructorDescriptor -> build()
is ScriptDescriptor -> build()
- is FunctionDescriptor -> build()
is PropertyDescriptor -> build()
- is PropertyGetterDescriptor -> build()
- is PropertySetterDescriptor -> build()
+ is PropertyAccessorDescriptor -> build()
+ is FunctionDescriptor -> build()
is TypeParameterDescriptor -> build()
is ValueParameterDescriptor -> build()
is ReceiverParameterDescriptor -> build()
@@ -192,6 +191,17 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
}
+ fun PropertyAccessorDescriptor.build(): DocumentationNode {
+ val doc = parseDocumentation(this)
+ val specialName = getName().asString().drop(1).takeWhile { it != '-' }
+ val node = DocumentationNode(specialName, doc, Kind.PropertyAccessor)
+
+ node.appendChildren(getValueParameters(), DocumentationReference.Kind.Detail)
+ node.appendType(getReturnType())
+ register(this, node)
+ return node
+ }
+
fun PropertyDescriptor.build(): DocumentationNode {
val node = DocumentationNode(this, Kind.Property)
node.appendChildren(getTypeParameters(), DocumentationReference.Kind.Detail)
@@ -257,14 +267,16 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
* $node: [DocumentationNode] to visit
*/
public fun resolveReferences(node: DocumentationNode) {
- node.details(DocumentationNode.Kind.Receiver).forEach { detail ->
- val receiverType = detail.detail(DocumentationNode.Kind.Type)
- val descriptor = links[receiverType]
- if (descriptor != null) {
- val typeNode = descriptorToNode[descriptor]
- // if typeNode is null, extension is to external type like in a library
- // should we create dummy node here?
- typeNode?.addReferenceTo(node, DocumentationReference.Kind.Extension)
+ if (node.kind != Kind.PropertyAccessor) {
+ node.details(DocumentationNode.Kind.Receiver).forEach { receiver ->
+ val receiverType = receiver.detail(DocumentationNode.Kind.Type)
+ val descriptor = links[receiverType]
+ if (descriptor != null) {
+ val typeNode = descriptorToNode[descriptor]
+ // if typeNode is null, extension is to external type like in a library
+ // should we create dummy node here?
+ typeNode?.addReferenceTo(node, DocumentationReference.Kind.Extension)
+ }
}
}
node.details(DocumentationNode.Kind.Supertype).forEach { detail ->