mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 05:51:25 +07:00
quick javadoc: include new javadoc tags in view (IDEA-128304)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 void <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>
|
||||
13
java/java-tests/testData/codeInsight/javadocIG/apiNotes.java
Normal file
13
java/java-tests/testData/codeInsight/javadocIG/apiNotes.java
Normal file
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
/**
|
||||
* @apiNote
|
||||
* my api note
|
||||
*
|
||||
* @implSpec
|
||||
* my impl spec
|
||||
*
|
||||
* @implNote
|
||||
* my impl note
|
||||
*/
|
||||
public void foo(){}
|
||||
}
|
||||
@@ -113,6 +113,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
doTestMethod();
|
||||
}
|
||||
|
||||
public void testApiNotes() throws Exception {
|
||||
doTestMethod();
|
||||
}
|
||||
|
||||
public void testLiteral() throws Exception {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user