From 77effb4fa1e9263c30ef3594934e91d51df6bae3 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 16 Feb 2015 12:10:50 +0100 Subject: don't lose tag value where it's actually part of the description --- src/Java/JavaDocumentationBuilder.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index 660ffafb..c76c4c33 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -31,11 +31,11 @@ public class JavaDocumentationBuilder() { val text = if (result.isEmpty()) it.getText().trimLeading() else it.getText() result.append(ContentText(text)) } - docComment.getTags().forEach { - val subjectName = it.getSubjectName() - val section = result.addSection(javadocSectionDisplayName(it.getName()), subjectName) - it.getDataElements().forEach { - if (it !is PsiDocTagValue) { + 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())) } } @@ -44,7 +44,7 @@ public class JavaDocumentationBuilder() { } fun PsiDocTag.getSubjectName(): String? { - if (getName() == "param") { + if (getName() == "param" || getName() == "throws" || getName() == "exception") { return getValueElement()?.getText() } return null -- cgit