quick javadoc: include new javadoc tags in view (IDEA-128304)

This commit is contained in:
Anna Kozlova
2014-12-24 12:26:07 +01:00
parent fc2f15f64e
commit e130ff2669
4 changed files with 34 additions and 0 deletions

View File

@@ -585,11 +585,26 @@ public class JavaDocInfoGenerator {
public void generateCommonSection(StringBuilder buffer, PsiDocComment docComment) {
generateDescription(buffer, docComment);
generateApiSection(buffer, docComment);
generateDeprecatedSection(buffer, docComment);
generateSinceSection(buffer, docComment);
generateSeeAlsoSection(buffer, docComment);
}
private void generateApiSection(StringBuilder buffer, PsiDocComment comment) {
final String[] tagNames = {"apiNote", "implSpec", "implNote"};
for (String tagName : tagNames) {
PsiDocTag tag = comment.findTagByName(tagName);
if (tag != null) {
buffer.append("<DD><DL>");
buffer.append("<DT><b>").append(tagName).append("</b>");
buffer.append("<DD>");
generateValue(buffer, tag.getDataElements(), ourEmptyElementsProvider);
buffer.append("</DD></DL></DD>");
}
}
}
private void generatePackageHtmlJavaDoc(final StringBuilder buffer, final PsiFile packageHtmlFile, boolean generatePrologueAndEpilogue) {
String htmlText = packageHtmlFile.getText();
@@ -912,6 +927,7 @@ public class JavaDocInfoGenerator {
generateThrowsSection(buffer, method, comment);
if (comment != null) {
generateApiSection(buffer, comment);
generateSinceSection(buffer, comment);
generateSeeAlsoSection(buffer, comment);
}

View File

@@ -0,0 +1 @@
<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://Test"><code>Test</code></a></b></small><PRE>public&nbsp;void&nbsp;<b>foo</b>()</PRE><DD><DL><DT><b>apiNote</b><DD> my api note </DD></DL></DD><DD><DL><DT><b>implSpec</b><DD> my impl spec </DD></DL></DD><DD><DL><DT><b>implNote</b><DD> my impl note</DD></DL></DD></body></html>

View File

@@ -0,0 +1,13 @@
class Test {
/**
* @apiNote
* my api note
*
* @implSpec
* my impl spec
*
* @implNote
* my impl note
*/
public void foo(){}
}

View File

@@ -113,6 +113,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
doTestMethod();
}
public void testApiNotes() throws Exception {
doTestMethod();
}
public void testLiteral() throws Exception {
doTestField();
}