quick doc: move non code annotation explanation to the bottom to reduce annoyance(IDEA-179266)

This commit is contained in:
peter
2017-12-18 10:02:19 +01:00
parent 23ab8636c5
commit b755bbb683
4 changed files with 22 additions and 25 deletions
@@ -472,14 +472,14 @@ public class JavaDocInfoGenerator {
if (generateClassSignature(buffer, aClass, SignaturePlace.Javadoc)) return;
buffer.append("</PRE>");
new NonCodeAnnotationGenerator(aClass, buffer).explainAnnotations();
PsiDocComment comment = getDocComment(aClass);
if (comment != null) {
generateCommonSection(buffer, comment);
generateTypeParametersSection(buffer, aClass);
}
new NonCodeAnnotationGenerator(aClass, buffer).explainAnnotations();
if (generatePrologueAndEpilogue) generateEpilogue(buffer);
}
@@ -626,8 +626,6 @@ public class JavaDocInfoGenerator {
generateFieldSignature(buffer, field, SignaturePlace.Javadoc);
buffer.append("</PRE>");
new NonCodeAnnotationGenerator(field, buffer).explainAnnotations();
ColorUtil.appendColorPreview(field, buffer);
PsiDocComment comment = getDocComment(field);
@@ -635,6 +633,8 @@ public class JavaDocInfoGenerator {
generateCommonSection(buffer, comment);
}
new NonCodeAnnotationGenerator(field, buffer).explainAnnotations();
if (generatePrologueAndEpilogue) generateEpilogue(buffer);
}
@@ -908,8 +908,6 @@ public class JavaDocInfoGenerator {
buffer.append("</b>");
buffer.append("</PRE>");
new NonCodeAnnotationGenerator(parameter, buffer).explainAnnotations();
final PsiElement method = PsiTreeUtil.getParentOfType(parameter, PsiMethod.class, PsiLambdaExpression.class);
if (method instanceof PsiMethod) {
@@ -927,6 +925,8 @@ public class JavaDocInfoGenerator {
}
}
new NonCodeAnnotationGenerator(parameter, buffer).explainAnnotations();
if (generatePrologueAndEpilogue) generateEpilogue(buffer);
}
@@ -964,8 +964,6 @@ public class JavaDocInfoGenerator {
generateMethodSignature(buffer, method, SignaturePlace.Javadoc);
buffer.append("</PRE>");
new NonCodeAnnotationGenerator(method, buffer).explainAnnotations();
PsiDocComment comment = getMethodDocComment(method);
generateMethodDescription(buffer, method, comment);
@@ -988,6 +986,8 @@ public class JavaDocInfoGenerator {
generateSeeAlsoSection(buffer, comment);
}
new NonCodeAnnotationGenerator(method, buffer).explainAnnotations();
if (generatePrologueAndEpilogue) generateEpilogue(buffer);
}
@@ -1,13 +1,12 @@
<html><head><base href="placeholder"> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://java.util.List"><code>java.util.List&lt;E&gt;</code></a></b></small><PRE><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>Contract</code></a>(pure = true)</i>&nbsp;
public abstract&nbsp;boolean&nbsp;<b>contains</b>(<a href="psi_element://java.lang.Object"><code>Object</code></a>&nbsp;o)</PRE>
<i>Inferred</i> annotations available:<br>
<ul>
<li><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>org.jetbrains.annotations.Contract</code></a>(pure = true)</i></li>
</ul>
Returns <tt>true</tt> if this list contains the specified element.
More formally, returns <tt>true</tt> if and only if this list contains
at least one element <tt>e</tt> such that
<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
<DD><DL><DT><b>Overrides:</b><DD><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://java.util.Collection"><code>Collection</code></a></DD></DL></DD><DD><DL><DT><b>Parameters:</b><DD><code>o</code> - element whose presence in this list is to be tested </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD><tt>true</tt> if this list contains the specified element </DD></DL></DD><DD><DL><DT><b>Throws:</b><DD><a href="psi_element://java.lang.ClassCastException"><code>ClassCastException</code></a> - if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <DD><a href="psi_element://java.lang.NullPointerException"><code>NullPointerException</code></a> - if the specified element is null and this list does not permit null elements (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>)</DD></DL></DD></body></html>
<DD><DL><DT><b>Overrides:</b><DD><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://java.util.Collection"><code>Collection</code></a></DD></DL></DD><DD><DL><DT><b>Parameters:</b><DD><code>o</code> - element whose presence in this list is to be tested </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD><tt>true</tt> if this list contains the specified element </DD></DL></DD><DD><DL><DT><b>Throws:</b><DD><a href="psi_element://java.lang.ClassCastException"><code>ClassCastException</code></a> - if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <DD><a href="psi_element://java.lang.NullPointerException"><code>NullPointerException</code></a> - if the specified element is null and this list does not permit null elements (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>)</DD></DL></DD>
<i>Inferred</i> annotations available:<br>
<ul>
<li><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>org.jetbrains.annotations.Contract</code></a>(pure = true)</i></li>
</ul></body></html>
@@ -1,13 +1,12 @@
<html><head><base href="placeholder"> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://My"><code>My</code></a></b></small><PRE><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>Contract</code></a>(pure = true)</i>&nbsp;
boolean&nbsp;<b>contains</b>(<a href="psi_element://java.lang.Object"><code>Object</code></a>&nbsp;o)</PRE>
<i>Inferred</i> annotations available:<br>
<ul>
<li><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>org.jetbrains.annotations.Contract</code></a>(pure = true)</i></li>
</ul>
<DD><DL><DT><b>Description copied from interface:</b>&nbsp;<a href="psi_element://java.util.Collection"><code>java.util.Collection</code></a><br>
boolean&nbsp;<b>contains</b>(<a href="psi_element://java.lang.Object"><code>Object</code></a>&nbsp;o)</PRE><DD><DL><DT><b>Description copied from interface:</b>&nbsp;<a href="psi_element://java.util.Collection"><code>java.util.Collection</code></a><br>
Returns <tt>true</tt> if this collection contains the specified element.
More formally, returns <tt>true</tt> if and only if this collection
contains at least one element <tt>e</tt> such that
<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
</DD></DL></DD><DD><DL><DT><b>Overrides:</b><DD><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://java.util.Collection"><code>Collection</code></a><DD><a href="psi_element://I#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://I"><code>I</code></a></DD></DL></DD><DD><DL><DT><b>Parameters:</b><DD><code>o</code> - element whose presence in this collection is to be tested </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD><tt>true</tt> if this collection contains the specified element </DD></DL></DD><DD><DL><DT><b>Throws:</b><DD><a href="psi_element://java.lang.ClassCastException"><code>ClassCastException</code></a> - if the type of the specified element is incompatible with this collection (<a href="psi_element://My###optional-restrictions">optional</a>) <DD><a href="psi_element://java.lang.NullPointerException"><code>NullPointerException</code></a> - if the specified element is null and this collection does not permit null elements (<a href="psi_element://My###optional-restrictions">optional</a>)</DD></DL></DD></body></html>
</DD></DL></DD><DD><DL><DT><b>Overrides:</b><DD><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://java.util.Collection"><code>Collection</code></a><DD><a href="psi_element://I#contains(java.lang.Object)"><code>contains</code></a> in interface <a href="psi_element://I"><code>I</code></a></DD></DL></DD><DD><DL><DT><b>Parameters:</b><DD><code>o</code> - element whose presence in this collection is to be tested </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD><tt>true</tt> if this collection contains the specified element </DD></DL></DD><DD><DL><DT><b>Throws:</b><DD><a href="psi_element://java.lang.ClassCastException"><code>ClassCastException</code></a> - if the type of the specified element is incompatible with this collection (<a href="psi_element://My###optional-restrictions">optional</a>) <DD><a href="psi_element://java.lang.NullPointerException"><code>NullPointerException</code></a> - if the specified element is null and this collection does not permit null elements (<a href="psi_element://My###optional-restrictions">optional</a>)</DD></DL></DD>
<i>Inferred</i> annotations available:<br>
<ul>
<li><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>org.jetbrains.annotations.Contract</code></a>(pure = true)</i></li>
</ul></body></html>
@@ -1,9 +1,8 @@
<html><head><base href="placeholder"> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://En"><code>En</code></a></b></small><PRE><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>Contract</code></a>(pure = true)</i>&nbsp;
static&nbsp;int&nbsp;<b>valueOf</b>(int&nbsp;i)</PRE>
myjavadoc
<DD><DL><DT><b>Parameters:</b><DD><code>i</code> - </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD></DD></DL></DD>
<i>Inferred</i> annotations available:<br>
<ul>
<li><i>@<a href="psi_element://org.jetbrains.annotations.Contract"><code>org.jetbrains.annotations.Contract</code></a>(pure = true)</i></li>
</ul>
myjavadoc
<DD><DL><DT><b>Parameters:</b><DD><code>i</code> - </DD></DL></DD><DD><DL><DT><b>Returns:</b><DD></DD></DL></DD></body></html>
</ul></body></html>