From e4b2ae90bf0e84f76ceb7c56b7c128d28adad917 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 30 Oct 2015 18:43:48 +0100 Subject: initial support for generating javadoc from Kotlin light classes --- src/Java/JavaDocumentationBuilder.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Java') diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index f3cedc07..660ac4a8 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -15,7 +15,11 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions, return } val packageNode = module.findOrCreatePackageNode(file.packageName, emptyMap()) - packageNode.appendChildren(file.classes) { build() } + appendClasses(packageNode, file.classes) + } + + fun appendClasses(packageNode: DocumentationNode, classes: Array) { + packageNode.appendChildren(classes) { build() } } data class JavadocParseResult(val content: Content, val deprecatedContent: Content?) @@ -47,9 +51,9 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions, private fun PsiDocTag.contentElements(): Iterable { val tagValueElements = children - .dropWhile { it.node.elementType == JavaDocTokenType.DOC_TAG_NAME } + .dropWhile { it.node?.elementType == JavaDocTokenType.DOC_TAG_NAME } .dropWhile { it is PsiWhiteSpace } - .filterNot { it.node.elementType == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS } + .filterNot { it.node?.elementType == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS } return if (getSubjectName() != null) tagValueElements.dropWhile { it is PsiDocTagValue } else tagValueElements } -- cgit