IDEA-130773 Shorten inferred org.jetbrains.annotations.Nullable/NotNull names in javadoc

This commit is contained in:
peter
2014-10-04 09:55:23 +02:00
parent 58ba717287
commit bd298abb73
2 changed files with 10 additions and 4 deletions
@@ -740,7 +740,11 @@ public class JavaDocInfoGenerator {
if (inferred) buffer.append("<i>");
final PsiClassType type = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createType(annotationType, PsiSubstitutor.EMPTY);
buffer.append("@");
generateType(buffer, type, owner, generateLink);
if (inferred && !generateLink) {
buffer.append(type.getPresentableText());
} else {
generateType(buffer, type, owner, generateLink);
}
final PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
if (attributes.length > 0) {
buffer.append("(");
@@ -778,9 +782,11 @@ public class JavaDocInfoGenerator {
}
} else if (external) {
if (inferred) buffer.append("<i>");
buffer.append(XmlStringUtil.escapeString(annotation.getText()));
buffer.append("&nbsp;");
String annoText = inferred ? "@" + annotation.getNameReferenceElement().getReferenceName() + annotation.getParameterList().getText()
: annotation.getText();
buffer.append(XmlStringUtil.escapeString(annoText));
if (inferred) buffer.append("</i>");
buffer.append("&nbsp;");
}
else {
buffer.append("<font color=red>");
@@ -132,7 +132,7 @@ public class BytecodeAnalysisIntegrationTest extends JavaCodeInsightFixtureTestC
public void testInferredAnnoGutter() {
setUpLibraries();
openDecompiledClass("org.apache.velocity.util.ExceptionUtils");
checkHasGutter("<i>@org.jetbrains.annotations.Contract(&quot;null,_,_-&gt;null&quot;)</i>");
checkHasGutter("<i>@Contract(&quot;null,_,_-&gt;null&quot;)</i>");
}
public void testExternalAnnoGutter() {