aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-09 19:57:54 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-09 19:57:54 +0100
commit1a4794397f3e5db8dac12d1797edd16c121de21f (patch)
treea93d0c1c75048f9622431409865f318162c77b72
parent4b0dcee83efbdb77ae5e389ee04c309c52446153 (diff)
downloaddokka-1a4794397f3e5db8dac12d1797edd16c121de21f.tar.gz
dokka-1a4794397f3e5db8dac12d1797edd16c121de21f.tar.bz2
dokka-1a4794397f3e5db8dac12d1797edd16c121de21f.zip
don't include unresolved annotatons in the doc
-rw-r--r--src/Kotlin/DocumentationBuilder.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 99c81760..844d8290 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -127,7 +127,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
fun DocumentationNode.appendAnnotations(annotated: Annotated) {
annotated.getAnnotations().forEach {
- append(it.build(), DocumentationReference.Kind.Annotation)
+ it.build()?.let { append(it, DocumentationReference.Kind.Annotation) }
}
}
@@ -325,8 +325,11 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
return node
}
- fun AnnotationDescriptor.build(): DocumentationNode {
+ fun AnnotationDescriptor.build(): DocumentationNode? {
val annotationClass = getType().getConstructor().getDeclarationDescriptor()
+ if (ErrorUtils.isError(annotationClass)) {
+ return null
+ }
val node = DocumentationNode(annotationClass.getName().asString(), Content.Empty, DocumentationNode.Kind.Annotation)
val arguments = getAllValueArguments().toList().sortBy { it.first.getIndex() }
arguments.forEach {