aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 21:43:38 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 21:43:38 +0400
commita8e59d7af41ca05b68e2d916552cecbbacbf3e92 (patch)
tree34c95981c8d08fa28706ad1c8d2ccef91e2776ad /src/Model
parent197a6e486d16d2e3689e900b45c65ef8d598f3b7 (diff)
downloaddokka-a8e59d7af41ca05b68e2d916552cecbbacbf3e92.tar.gz
dokka-a8e59d7af41ca05b68e2d916552cecbbacbf3e92.tar.bz2
dokka-a8e59d7af41ca05b68e2d916552cecbbacbf3e92.zip
Add tests for comment extraction, support one-line and mutliple joined doc-comments.
Start primitive ConsoleGenerator to dump model.
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/DocumentationBuilder.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Model/DocumentationBuilder.kt b/src/Model/DocumentationBuilder.kt
index 77f74eb2..08298926 100644
--- a/src/Model/DocumentationBuilder.kt
+++ b/src/Model/DocumentationBuilder.kt
@@ -19,21 +19,21 @@ fun BindingContext.createDocumentation(file: JetFile): DocumentationModel {
class DocumentationBuilderVisitor(val context: BindingContext) : DeclarationDescriptorVisitorEmptyBodies<DocumentationNode, DocumentationNode>() {
override fun visitDeclarationDescriptor(descriptor: DeclarationDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Unknown)
data?.addReferenceTo(node, DocumentationReferenceKind.Member)
return node
}
override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Parameter)
data?.addReferenceTo(node, DocumentationReferenceKind.Detail)
return node
}
override fun visitClassDescriptor(descriptor: ClassDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc,
when (descriptor.getKind()) {
ClassKind.OBJECT -> DocumentationNodeKind.Object
@@ -45,21 +45,21 @@ class DocumentationBuilderVisitor(val context: BindingContext) : DeclarationDesc
}
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Function)
data?.addReferenceTo(node, DocumentationReferenceKind.Member)
return node
}
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Property)
data?.addReferenceTo(node, DocumentationReferenceKind.Member)
return node
}
override fun visitConstructorDescriptor(descriptor: ConstructorDescriptor?, data: DocumentationNode?): DocumentationNode? {
- val doc = context.getDocumentation(descriptor!!).extractText()
+ val doc = context.getDocumentation(descriptor!!)
val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Constructor)
data?.addReferenceTo(node, DocumentationReferenceKind.Member)
return node