aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Java/JavadocParser.kt
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2019-02-05 16:05:15 +0100
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-02-25 19:45:58 +0300
commita2104d1e24a452cbfd2a76c204fc58475aa70057 (patch)
tree414a18a39cfd2436de962e594076a7e0f282581e /core/src/main/kotlin/Java/JavadocParser.kt
parent5b451ab6abf60e15c8044daebc90c3a46c21c4fb (diff)
downloaddokka-a2104d1e24a452cbfd2a76c204fc58475aa70057.tar.gz
dokka-a2104d1e24a452cbfd2a76c204fc58475aa70057.tar.bz2
dokka-a2104d1e24a452cbfd2a76c204fc58475aa70057.zip
Fix @deprecated visibility in JavaDoc (#420)
#343 Fixed
Diffstat (limited to 'core/src/main/kotlin/Java/JavadocParser.kt')
-rw-r--r--core/src/main/kotlin/Java/JavadocParser.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt
index d6e46c50..39a4568a 100644
--- a/core/src/main/kotlin/Java/JavadocParser.kt
+++ b/core/src/main/kotlin/Java/JavadocParser.kt
@@ -83,7 +83,7 @@ class JavadocParser(
"see" -> result.convertSeeTag(tag)
"deprecated" -> {
deprecatedContent = Content().apply {
- appendAll(convertJavadocElements(tag.contentElements(), element))
+ appendAll(convertJavadocElements(tag.contentElementsOrFirstChild(), element))
}
}
in tagsToInherit -> {}
@@ -122,9 +122,10 @@ class JavadocParser(
recursiveSearch(arrayOf(this))
return output.mapValues { it.value.values }
}
+ private fun PsiDocTag.contentElementsOrFirstChild(): Collection<PsiElement> = contentElements()
+ .takeIf { it.isNotEmpty() } ?: children.take(1)
-
- private fun PsiDocTag.contentElements(): Iterable<PsiElement> {
+ private fun PsiDocTag.contentElements(): Collection<PsiElement> {
val tagValueElements = children
.dropWhile { it.node?.elementType == JavaDocTokenType.DOC_TAG_NAME }
.dropWhile { it is PsiWhiteSpace }