javadoc: remove indentation for throws list

This commit is contained in:
Anna.Kozlova
2018-02-15 16:31:11 +01:00
parent 434af76def
commit 983063a7bf
5 changed files with 13 additions and 19 deletions
@@ -78,6 +78,7 @@ public class JavaDocInfoGenerator {
private static final String VALUE_TAG = "value";
private static final String LT = "<";
private static final String GT = ">";
private static final String NBSP = " ";
private static final Pattern ourWhitespaces = Pattern.compile("[ \\n\\r\\t]+");
private static final Pattern ourRelativeHtmlLinks = Pattern.compile("<A.*?HREF=\"([^\":]*)\"", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
@@ -877,7 +878,7 @@ public class JavaDocInfoGenerator {
for (AnnotationDocGenerator anno : AnnotationDocGenerator.getAnnotationsToShow(owner)) {
anno.generateAnnotation(buffer, format);
buffer.append("&nbsp;");
buffer.append(NBSP);
if (splitAnnotations) buffer.append("\n");
}
}
@@ -1084,7 +1085,7 @@ public class JavaDocInfoGenerator {
int indent = 0;
if (!modifiers.isEmpty()) {
buffer.append(modifiers);
buffer.append("&nbsp;");
buffer.append(NBSP);
indent += modifiers.length() + 1;
}
@@ -1092,13 +1093,13 @@ public class JavaDocInfoGenerator {
indent += StringUtil.unescapeXml(StringUtil.stripHtml(typeParamsString, true)).length();
if (!typeParamsString.isEmpty()) {
buffer.append(typeParamsString);
buffer.append("&nbsp;");
buffer.append(NBSP);
indent++;
}
if (method.getReturnType() != null) {
indent += generateType(buffer, method.getReturnType(), method, generateLink, useShortNames);
buffer.append("&nbsp;");
buffer.append(NBSP);
indent++;
}
buffer.append("<b>");
@@ -1114,7 +1115,7 @@ public class JavaDocInfoGenerator {
PsiParameter parm = parameters[i];
generateAnnotations(buffer, parm, place, false);
generateType(buffer, parm.getType(), method, generateLink, useShortNames);
buffer.append("&nbsp;");
buffer.append(NBSP);
if (parm.getName() != null) {
buffer.append(parm.getName());
}
@@ -1128,20 +1129,13 @@ public class JavaDocInfoGenerator {
PsiClassType[] refs = method.getThrowsList().getReferencedTypes();
if (refs.length > 0) {
buffer.append("\n");
indent -= THROWS_KEYWORD.length() + 1;
for (int i = 0; i < indent; i++) {
buffer.append(" ");
}
indent += THROWS_KEYWORD.length() + 1;
buffer.append(THROWS_KEYWORD);
buffer.append("&nbsp;");
buffer.append(NBSP);
for (int i = 0; i < refs.length; i++) {
generateLink(buffer, useShortNames ? refs[i].getPresentableText() : refs[i].getCanonicalText(), null, method, false);
if (i < refs.length - 1) {
buffer.append(",\n");
for (int j = 0; j < indent; j++) {
buffer.append(" ");
}
buffer.append(",")
.append(NBSP);
}
}
}
@@ -1,2 +1,2 @@
<div class='definition'><pre><a href="psi_element://Idea4780"><code>Idea4780</code></a><br>public&nbsp;<a href="psi_element://java.lang.Object"><code>Object</code></a>&nbsp;<b>read</b>()
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; if an I/O error occurs while reading. <p><a href="psi_element://java.io.EOFException"><code>EOFException</code></a> &ndash; if this source is already closed when the <code>read()</code> is called, or is closed during the <code>read()</code>. <p><font color=red>InterruptedIOException</font> &ndash; if the reading thread is interrupted.</td></table>
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; if an I/O error occurs while reading. <p><a href="psi_element://java.io.EOFException"><code>EOFException</code></a> &ndash; if this source is already closed when the <code>read()</code> is called, or is closed during the <code>read()</code>. <p><font color=red>InterruptedIOException</font> &ndash; if the reading thread is interrupted.</td></table>
@@ -1,2 +1,2 @@
<div class='definition'><pre><a href="psi_element://InheritedDocInThrows"><code>InheritedDocInThrows</code></a><br>void&nbsp;<b>foo</b>()
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Overrides:</td><td><p><a href="psi_element://A#foo()"><code>foo</code></a> in class <a href="psi_element://A"><code>A</code></a></td><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; la-la-la</td></table>
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Overrides:</td><td><p><a href="psi_element://A#foo()"><code>foo</code></a> in class <a href="psi_element://A"><code>A</code></a></td><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; la-la-la</td></table>
@@ -1,2 +1,2 @@
<div class='definition'><pre><a href="psi_element://InheritedDocInThrows1"><code>InheritedDocInThrows1</code></a><br>void&nbsp;<b>foo</b>()
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Overrides:</td><td><p><a href="psi_element://A#foo()"><code>foo</code></a> in class <a href="psi_element://A"><code>A</code></a></td><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; comment</td></table>
throws&nbsp;<a href="psi_element://java.io.IOException"><code>IOException</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Overrides:</td><td><p><a href="psi_element://A#foo()"><code>foo</code></a> in class <a href="psi_element://A"><code>A</code></a></td><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://java.io.IOException"><code>IOException</code></a> &ndash; comment</td></table>
@@ -1,3 +1,3 @@
<div class='definition'><pre><a href="psi_element://Producer"><code>Producer&lt;T&gt;</code></a><br>&lt;E extends <a href="psi_element://java.lang.Exception"><code>Exception</code></a>&gt;&nbsp;void&nbsp;<b>drainTo</b>(<a href="psi_element://Consumer"><code>Consumer</code></a>&lt;? super T, E&gt;&nbsp;consumer,
<a href="psi_element://java.lang.Object"><code>Object</code></a>&nbsp;someParameter)
throws&nbsp;<a href="psi_element://E"><code>E</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://E"><code>E</code></a></td></table>
throws&nbsp;<a href="psi_element://E"><code>E</code></a></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>Throws:</td><td><p><a href="psi_element://E"><code>E</code></a></td></table>