aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-20 19:15:11 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-20 19:15:11 +0100
commit649217db5c05dbb466371870a2761f9c32b086f0 (patch)
treef49708a301f41393797988cbdd48e5b7f5262366 /src/Java
parentff0e6be0369f2778d33fd7aa4821548745172b80 (diff)
downloaddokka-649217db5c05dbb466371870a2761f9c32b086f0.tar.gz
dokka-649217db5c05dbb466371870a2761f9c32b086f0.tar.bz2
dokka-649217db5c05dbb466371870a2761f9c32b086f0.zip
process @see tags in javadoc
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/JavaDocumentationBuilder.kt28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt
index ddc526ac..5d54e214 100644
--- a/src/Java/JavaDocumentationBuilder.kt
+++ b/src/Java/JavaDocumentationBuilder.kt
@@ -30,23 +30,39 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions,
}
}
docComment.getTags().forEach { tag ->
- val subjectName = tag.getSubjectName()
- val section = result.addSection(javadocSectionDisplayName(tag.getName()), subjectName)
- tag.getDataElements().forEach {
- if (it !is PsiDocTagValue || tag.getSubjectName() == null) {
- section.append(ContentText(it.getText()))
+ if (tag.getName() == "see") {
+ result.convertSeeTag(tag)
+ } else {
+ val subjectName = tag.getSubjectName()
+ val section = result.addSection(javadocSectionDisplayName(tag.getName()), subjectName)
+ tag.getDataElements().forEach {
+ if (it !is PsiDocTagValue || tag.getSubjectName() == null) {
+ section.append(ContentText(it.getText()))
+ }
}
}
}
return result
}
+ private fun Content.convertSeeTag(tag: PsiDocTag) {
+ val seeSection = findSectionByTag("See Also") ?: addSection("See Also", null)
+ val linkNode = resolveLink(tag.getValueElement())
+ val text = ContentText(tag.getValueElement()!!.getText())
+ if (linkNode != null) {
+ linkNode.append(text)
+ seeSection.append(linkNode)
+ } else {
+ seeSection.append(text)
+ }
+ }
+
private fun convertInlineDocTag(tag: PsiInlineDocTag) = when (tag.getName()) {
"link", "linkplain" -> resolveLink(tag.getValueElement()) ?: ContentText(tag.getText())
else -> ContentText(tag.getText())
}
- private fun resolveLink(valueElement: PsiDocTagValue?): ContentNode? {
+ private fun resolveLink(valueElement: PsiDocTagValue?): ContentBlock? {
val target = valueElement?.getReference()?.resolve()
if (target != null) {
val signature = getSignature(target)