diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-12-22 17:38:56 +0300 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-12-22 17:38:56 +0300 |
commit | c759876cf6401e11311be0e480233592ed627bb4 (patch) | |
tree | 22ef31c737c5a81aef85ba0a31bbdfd7131124b0 /src/Kotlin/DocumentationBuilder.kt | |
parent | 7d81b307b74be72e945184d4ba26c833a25a497d (diff) | |
download | dokka-c759876cf6401e11311be0e480233592ed627bb4.tar.gz dokka-c759876cf6401e11311be0e480233592ed627bb4.tar.bz2 dokka-c759876cf6401e11311be0e480233592ed627bb4.zip |
Append modifiers and visibility to property accessors
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 7d38480a..d2c07200 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -35,14 +35,18 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati fun DocumentationNode<T>(descriptor: T, kind: Kind): DocumentationNode where T : DeclarationDescriptor, T : Named { val doc = parseDocumentation(descriptor) - val node = DocumentationNode(descriptor.getName().asString(), doc, kind) + val node = DocumentationNode(descriptor.getName().asString(), doc, kind).withModifiers(descriptor) + return node + } + + private fun DocumentationNode.withModifiers(descriptor: DeclarationDescriptor) : DocumentationNode{ if (descriptor is MemberDescriptor) { - node.appendVisibility(descriptor) + appendVisibility(descriptor) if (descriptor !is ConstructorDescriptor) { - node.appendModality(descriptor) + appendModality(descriptor) } } - return node + return this } fun DocumentationNode.append(child: DocumentationNode, kind: DocumentationReference.Kind) { @@ -188,7 +192,7 @@ 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) + val node = DocumentationNode(specialName, doc, Kind.PropertyAccessor).withModifiers(this) node.appendChildren(getValueParameters(), DocumentationReference.Kind.Detail) node.appendType(getReturnType()) |