[javadoc] replace inferred/external explanation section with external links to help (IDEA-179266)

GitOrigin-RevId: 1e9a12f907fe6861eb0ad3ee975a11a34af4d75c
This commit is contained in:
Anna Kozlova
2022-02-09 14:02:19 +00:00
committed by intellij-monorepo-bot
parent c2899bebcb
commit 5fabc33985
12 changed files with 31 additions and 88 deletions
@@ -1,16 +1,18 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.javadoc;
import com.intellij.codeInsight.AnnotationTargetUtil;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.lang.Language;
import com.intellij.lang.documentation.DocumentationMarkup;
import com.intellij.lang.documentation.DocumentationSettings;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.richcopy.HtmlSyntaxInfoUtil;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.util.ObjectUtils;
@@ -112,19 +114,20 @@ public final class AnnotationDocGenerator {
AnnotationFormat format,
boolean generateLink,
boolean isForRenderedDoc,
boolean doSyntaxHighlighting
) {
boolean doSyntaxHighlighting) {
String qualifiedName = myAnnotation.getQualifiedName();
PsiClassType type = myTargetClass != null && qualifiedName != null &&
JavaDocUtil.findReferenceTarget(myContext.getManager(), qualifiedName, myContext) != null
? JavaPsiFacade.getElementFactory(myContext.getProject()).createType(myTargetClass, PsiSubstitutor.EMPTY)
: null;
boolean red = type == null && !myResolveNotPossible && !isInferred() && !isExternal();
boolean isInferred = isInferred();
boolean red = type == null && !myResolveNotPossible && !isInferred && !isExternal();
boolean highlightNonCodeAnnotations = format == AnnotationFormat.ToolTip && (isInferred() || isExternal());
boolean isNonCodeAnnotation = isInferred || isExternal();
boolean highlightNonCodeAnnotations = format == AnnotationFormat.ToolTip && isNonCodeAnnotation;
if (highlightNonCodeAnnotations) buffer.append("<b>");
if (isInferred()) buffer.append("<i>");
if (isInferred) buffer.append("<i>");
if (red) buffer.append("<font color=red>");
boolean forceShortNames = format != AnnotationFormat.JavaDocComplete;
@@ -152,8 +155,13 @@ public final class AnnotationDocGenerator {
if (red) buffer.append("</font>");
generateAnnotationAttributes(buffer, generateLink, isForRenderedDoc, doSyntaxHighlighting);
if (isInferred()) buffer.append("</i>");
if (isInferred) buffer.append("</i>");
if (highlightNonCodeAnnotations) buffer.append("</b>");
if (generateLink && isNonCodeAnnotation && !isForRenderedDoc) {
HtmlChunk.link(isInferred ? "https://www.jetbrains.com/help/idea/annotating-source-code.html#bundled-annotations"
: "https://www.jetbrains.com/help/idea/external-annotations.html",
DocumentationMarkup.EXTERNAL_LINK_ICON).appendTo(buffer);
}
}
private void generateAnnotationAttributes(
@@ -718,9 +718,6 @@ public class JavaDocInfoGenerator {
buffer.append(DocumentationMarkup.SECTIONS_START);
}
if (!isRendered()) {
new NonCodeAnnotationGenerator(aClass, buffer).explainAnnotations(isRendered(), doHighlightSignatures());
}
buffer.append(DocumentationMarkup.SECTIONS_END);
}
@@ -926,7 +923,6 @@ public class JavaDocInfoGenerator {
if (!isRendered()) {
JavaDocColorUtil.appendColorPreview(field, buffer);
new NonCodeAnnotationGenerator(field, buffer).explainAnnotations(isRendered(), doHighlightSignatures());
}
buffer.append(DocumentationMarkup.SECTIONS_END);
@@ -1267,9 +1263,6 @@ public class JavaDocInfoGenerator {
}
}
buffer.append(DocumentationMarkup.SECTIONS_START);
new NonCodeAnnotationGenerator(parameter, buffer).explainAnnotations(isRendered(), doHighlightSignatures());
buffer.append(DocumentationMarkup.SECTIONS_END);
}
public String generateMethodParameterJavaDoc() {
@@ -1400,10 +1393,6 @@ public class JavaDocInfoGenerator {
generateUnknownTagsSections(buffer, comment);
}
if (!isRendered()) {
new NonCodeAnnotationGenerator(method, buffer).explainAnnotations(isRendered(), doHighlightSignatures());
}
buffer.append(DocumentationMarkup.SECTIONS_END);
}
@@ -1,13 +1,9 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.javadoc;
import com.intellij.java.JavaBundle;
import com.intellij.lang.documentation.DocumentationMarkup;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiModifierListOwner;
import com.intellij.psi.PsiNamedElement;
import com.intellij.psi.util.JavaElementKind;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.Nls;
@@ -19,35 +15,6 @@ import java.util.Collections;
import java.util.List;
public class NonCodeAnnotationGenerator {
private final PsiModifierListOwner myOwner;
private final StringBuilder myOutput;
NonCodeAnnotationGenerator(@NotNull PsiModifierListOwner owner, StringBuilder output) {
myOwner = owner;
myOutput = output;
}
void explainAnnotations(boolean isForRenderedFoc, boolean doSyntaxHighlighting) {
MultiMap<PsiModifierListOwner, AnnotationDocGenerator> generators = getSignatureNonCodeAnnotations(myOwner);
if (generators.isEmpty()) return;
myOutput.append(DocumentationMarkup.SECTION_HEADER_START);
myOutput.append(getNonCodeHeader(generators.values())).append(":");
myOutput.append(DocumentationMarkup.SECTION_SEPARATOR);
generators.keySet().forEach(owner -> {
myOutput.append("<p>");
if (generators.size() > 1) {
myOutput.append(getKind(owner)).append(" <code>").append(((PsiNamedElement)owner).getName()).append("</code>: ").append("<br>");
}
List<AnnotationDocGenerator> annotations = new ArrayList<>(generators.get(owner));
for (int i = 0; i < annotations.size(); i++) {
if (i > 0) myOutput.append("<br>");
annotations.get(i).generateAnnotation(myOutput, AnnotationFormat.JavaDocComplete, true, isForRenderedFoc, doSyntaxHighlighting);
}
});
myOutput.append(DocumentationMarkup.SECTION_END);
}
@NotNull
public static MultiMap<PsiModifierListOwner, AnnotationDocGenerator> getSignatureNonCodeAnnotations(PsiModifierListOwner owner) {
@@ -72,20 +39,6 @@ public class NonCodeAnnotationGenerator {
return allOwners;
}
@NotNull
public static @Nls String getNonCodeHeader(Collection<AnnotationDocGenerator> values) {
boolean hasExternal = values.stream().anyMatch(AnnotationDocGenerator::isExternal);
boolean hasInferred = values.stream().anyMatch(AnnotationDocGenerator::isInferred);
if (hasExternal && hasInferred) {
return JavaBundle.message("non.code.annotations.explanation.external.and.inferred");
}
if (hasExternal) {
return JavaBundle.message("non.code.annotations.explanation.external");
}
return JavaBundle.message("non.code.annotations.explanation.inferred");
}
@NotNull
public static @Nls String getNonCodeHeaderAvalable(Collection<AnnotationDocGenerator> values) {
boolean hasExternal = values.stream().anyMatch(AnnotationDocGenerator::isExternal);
@@ -99,8 +52,4 @@ public class NonCodeAnnotationGenerator {
}
return JavaBundle.message("non.code.annotations.explanation.inferred.available");
}
private static String getKind(PsiModifierListOwner owner) {
return StringUtil.capitalize(JavaElementKind.fromElement(owner).subject());
}
}
@@ -1,8 +1,8 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span>&nbsp;
<html><head><base href="placeholder"></head><body><div class='definition'><pre><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span><a href="https://www.jetbrains.com/help/idea/external-annotations.html"><icon src="AllIcons.Ide.External_link_arrow"></a>&nbsp;
<span style="color:#000080;font-weight:bold;">public abstract</span>&nbsp;<span style="color:#000080;font-weight:bold;">boolean</span>&nbsp;<span style="color:#000000;">contains</span><span style="">(</span><br> <a href="psi_element://java.lang.Object"><code><span style="color:#000000;">Object</span></code></a>&nbsp;<span style="">o</span><br><span style="">)</span></pre></div><div class='content'>
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>.
</div><table class='sections'><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">o</span></code> &ndash; element whose presence in this list is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this list contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.ClassCastException"><code><span style="color:#0000ff;">ClassCastException</span></code></a> &ndash; if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> &ndash; 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>)</td><tr><td valign='top' class='section'><p>External<br> annotations:</td><td valign='top'><p><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><span style="color:#808000;">org.jetbrains.annotations.Contract</span></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://java.util.List"><code><span style="color:#000000;">java.util.List</span><span style="">&lt;</span><span style="color:#20999d;">E</span><span style="">&gt;</span></code></a></div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/>&nbsp;&lt; java 1.7 &gt;</div>
</div><table class='sections'><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">o</span></code> &ndash; element whose presence in this list is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this list contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.ClassCastException"><code><span style="color:#0000ff;">ClassCastException</span></code></a> &ndash; if the type of the specified element is incompatible with this list (<a href="psi_element://java.util.Collection###optional-restrictions">optional</a>) <p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> &ndash; 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>)</td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://java.util.List"><code><span style="color:#000000;">java.util.List</span><span style="">&lt;</span><span style="color:#20999d;">E</span><span style="">&gt;</span></code></a></div><div class="bottom"><icon src="AllIcons.Nodes.PpLibFolder"/>&nbsp;&lt; java 1.7 &gt;</div>
@@ -1,4 +1,4 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i>&nbsp;
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i><a href="https://www.jetbrains.com/help/idea/annotating-source-code.html#bundled-annotations"><icon src="AllIcons.Ide.External_link_arrow"></a>&nbsp;
<span style="color:#000080;font-weight:bold;">boolean</span>&nbsp;<span style="color:#000000;">contains</span><span style="">(</span><br> <a href="psi_element://java.lang.Object"><code><span style="color:#000000;">Object</span></code></a>&nbsp;<span style="">o</span><br><span style="">)</span>
<span style="color:#000080;font-weight:bold;">throws</span>&nbsp;<font color=red>IOException</font></pre></div><table class='sections'><p><tr><td valign='top' class='section'><p>From interface:</td><td valign='top'><p><a href="psi_element://java.util.Collection"><code><span style="color:#000000;">java.util.Collection</span></code></a><br>
Returns <tt>true</tt> if this collection contains the specified element.
@@ -6,4 +6,4 @@
contains at least one element <tt>e</tt> such that
<tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
</td><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a><br><a href="psi_element://I#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://I"><code><span style="color:#000000;">I</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">o</span></code> &ndash; element whose presence in this collection is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this collection contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> &ndash; before if the specified element is null and this collection does not permit null elements (<a href="psi_element://My###optional-restrictions">optional</a>) after<p><font color=red>IOException</font></td><tr><td valign='top' class='section'><p><i>Inferred</i><br> annotations:</td><td valign='top'><p><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><span style="color:#808000;">org.jetbrains.annotations.Contract</span></a><span style="">(</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://My"><code><span style="color:#000000;">My</span></code></a></div>
</td><tr><td valign='top' class='section'><p>Overrides:</td><td valign='top'><p><a href="psi_element://java.util.Collection#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://java.util.Collection"><code><span style="color:#000000;">Collection</span></code></a><br><a href="psi_element://I#contains(java.lang.Object)"><code><span style="color:#000000;">contains</span></code></a> in interface <a href="psi_element://I"><code><span style="color:#000000;">I</span></code></a></td><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">o</span></code> &ndash; element whose presence in this collection is to be tested </td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p><tt>true</tt> if this collection contains the specified element </td><tr><td valign='top' class='section'><p>Throws:</td><td valign='top'><p><a href="psi_element://java.lang.NullPointerException"><code><span style="color:#0000ff;">NullPointerException</span></code></a> &ndash; before if the specified element is null and this collection does not permit null elements (<a href="psi_element://My###optional-restrictions">optional</a>) after<p><font color=red>IOException</font></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://My"><code><span style="color:#000000;">My</span></code></a></div>
@@ -1,4 +1,4 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"_&#32;-&gt;&#32;param1"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i>&nbsp;
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"_&#32;-&gt;&#32;param1"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i><a href="https://www.jetbrains.com/help/idea/annotating-source-code.html#bundled-annotations"><icon src="AllIcons.Ide.External_link_arrow"></a>&nbsp;
<span style="color:#000080;font-weight:bold;">static</span>&nbsp;<span style="color:#000080;font-weight:bold;">int</span>&nbsp;<span style="color:#000000;">valueOf</span><span style="">(</span><br> <span style="color:#000080;font-weight:bold;">int</span>&nbsp;<span style="">i</span><br><span style="">)</span></pre></div><div class='content'>
myjavadoc
</div><table class='sections'><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">i</span></code></td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p></td><tr><td valign='top' class='section'><p><i>Inferred</i><br> annotations:</td><td valign='top'><p><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><span style="color:#808000;">org.jetbrains.annotations.Contract</span></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"_&#32;-&gt;&#32;param1"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://En"><code><span style="color:#000000;">En</span></code></a></div>
</div><table class='sections'><tr><td valign='top' class='section'><p>Params:</td><td valign='top'><code><span style="">i</span></code></td><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://En"><code><span style="color:#000000;">En</span></code></a></div>
@@ -1 +1 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><a href="psi_element://java.lang.String"><code><span style="color:#0000ff;">String</span></code></a> <span style="color:#000000;">s</span></pre></div><div class='content'><code><span style="">s</span></code> &ndash; String parameter.</div><table class='sections'></table>
<html><head><base href="placeholder"></head><body><div class='definition'><pre><a href="psi_element://java.lang.String"><code><span style="color:#0000ff;">String</span></code></a> <span style="color:#000000;">s</span></pre></div><div class='content'><code><span style="">s</span></code> &ndash; String parameter.</div>
@@ -1 +1 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><span style="color:#000080;font-weight:bold;">int</span> <span style="color:#000000;">a</span></pre></div><table class='sections'></table>
<html><head><base href="placeholder"></head><body><div class='definition'><pre><span style="color:#000080;font-weight:bold;">int</span> <span style="color:#000000;">a</span></pre></div>
@@ -1,4 +1,4 @@
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"&#32;-&gt;&#32;new"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i>&nbsp;
<html><head><base href="placeholder"></head><body><div class='definition'><pre><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><code><span style="color:#808000;">Contract</span></code></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"&#32;-&gt;&#32;new"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i><a href="https://www.jetbrains.com/help/idea/annotating-source-code.html#bundled-annotations"><icon src="AllIcons.Ide.External_link_arrow"></a>&nbsp;
<span style="color:#000080;font-weight:bold;">public static</span>&nbsp;<a href="psi_element://E"><code><span style="color:#000000;">E</span></code></a><span style="">[]</span>&nbsp;<span style="color:#000000;">values</span><span style="">(</span><span style="">)</span></pre></div><div class='content'>
Returns an array containing the constants of this enum
type, in the order they're declared. This method may be
@@ -8,4 +8,4 @@
System.out.println(c);
</pre>
</div><table class='sections'><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p>an array containing the constants of this enum type, in the order they're declared</td><tr><td valign='top' class='section'><p><i>Inferred</i><br> annotations:</td><td valign='top'><p><i><span style="color:#808000;">@</span><a href="psi_element://org.jetbrains.annotations.Contract"><span style="color:#808000;">org.jetbrains.annotations.Contract</span></a><span style="">(</span><span style="">value</span><span style=""> = </span><span style="color:#008000;font-weight:bold;">"&#32;-&gt;&#32;new"</span><span style="">,&nbsp;</span><span style="">pure</span><span style=""> = </span><span style="color:#000080;font-weight:bold;">true</span><span style="">)</span></i></td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://E"><code><span style="color:#000000;">E</span></code></a></div>
</div><table class='sections'><tr><td valign='top' class='section'><p>Returns:</td><td valign='top'><p>an array containing the constants of this enum type, in the order they're declared</td></table><div class="bottom"><icon src="AllIcons.Nodes.Class">&nbsp;<a href="psi_element://E"><code><span style="color:#000000;">E</span></code></a></div>
@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.java.codeInspection.bytecodeAnalysis;
import com.intellij.codeInsight.AnnotationUtil;
@@ -106,7 +106,7 @@ public class BytecodeAnalysisIntegrationTest extends LightJavaCodeInsightFixture
checkHasGutter("org.apache.velocity.util.ExceptionUtils",
"<html><i>Inferred</i> annotations available. Full signature:<p>\n" +
"<b><i><span style=\"color:#808000;\">@</span><a href=\"psi_element://org.jetbrains.annotations.Contract\"><code><span style=\"color:#808000;\">Contract</span></code></a><span style=\"\">(</span><span style=\"color:#008000;font-weight:bold;\">\"null,_,_->null\"</span><span style=\"\">)</span></i></b> \n" +
"<b><i><span style=\"color:#808000;\">@</span><a href=\"psi_element://org.jetbrains.annotations.Contract\"><code><span style=\"color:#808000;\">Contract</span></code></a><span style=\"\">(</span><span style=\"color:#008000;font-weight:bold;\">\"null,_,_->null\"</span><span style=\"\">)</span></i></b><a href=\"https://www.jetbrains.com/help/idea/annotating-source-code.html#bundled-annotations\"><icon src=\"AllIcons.Ide.External_link_arrow\"/></a> \n" +
"<span style=\"color:#000000;\">Throwable</span> <span style=\"color:#000000;\">createWithCause</span><span style=\"\">(</span><span style=\"color:#000000;\">Class</span><span style=\"\">,</span>\n" +
"<span style=\"color:#000000;\">String</span><span style=\"\">,</span>\n" +
"<span style=\"color:#000000;\">Throwable</span><span style=\"\">)</span></html>");
@@ -115,7 +115,7 @@ public class BytecodeAnalysisIntegrationTest extends LightJavaCodeInsightFixture
public void testExternalAnnoGutter() {
checkHasGutter("java.lang.String",
"<html>External annotations available. Full signature:<p>\n" +
"<span style=\"color:#000000;\">String</span><span style=\"\">(</span><b><span style=\"color:#808000;\">@</span><a href=\"psi_element://org.jetbrains.annotations.NotNull\"><code><span style=\"color:#808000;\">NotNull</span></code></a></b> <span style=\"color:#000080;font-weight:bold;\">char</span><span style=\"\">[]</span><span style=\"\">,</span>\n" +
"<span style=\"color:#000000;\">String</span><span style=\"\">(</span><b><span style=\"color:#808000;\">@</span><a href=\"psi_element://org.jetbrains.annotations.NotNull\"><code><span style=\"color:#808000;\">NotNull</span></code></a></b><a href=\"https://www.jetbrains.com/help/idea/external-annotations.html\"><icon src=\"AllIcons.Ide.External_link_arrow\"/></a> <span style=\"color:#000080;font-weight:bold;\">char</span><span style=\"\">[]</span><span style=\"\">,</span>\n" +
"<span style=\"color:#000080;font-weight:bold;\">int</span><span style=\"\">,</span>\n" +
"<span style=\"color:#000080;font-weight:bold;\">int</span><span style=\"\">)</span></html>");
}
@@ -1598,11 +1598,8 @@ generate.members.implement.command=implement
code.style.settings.angle.spacing.brackets=Angle brackets
code.style.settings.spacing.after.closing.angle.bracket=After closing angle bracket
code.style.settings.spacing.around.type.bounds=Around type bounds
non.code.annotations.explanation.external.and.inferred=External<br/> and <i>inferred</i><br/> annotations
non.code.annotations.explanation.external.and.inferred.available=External and <i>inferred</i> annotations available.
non.code.annotations.explanation.external=External<br/> annotations
non.code.annotations.explanation.external.available=External annotations available.
non.code.annotations.explanation.inferred=<i>Inferred</i><br/> annotations
non.code.annotations.explanation.inferred.available=<i>Inferred</i> annotations available.
non.code.annotations.explanation.full.signature=Full signature:
type.migration.command.name=TypeMigration
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.plugins.groovy
import com.intellij.codeInsight.navigation.CtrlMouseHandler
@@ -102,7 +102,7 @@ a<caret>a
List<String> ss = []
ss.collect { i<caret>t }
''', '''\
<div class='definition'><pre><a href="psi_element://java.lang.Object"><code><span style="color:#0000ff;">Object</span></code></a> <span style="color:#000000;">it</span></pre></div><table class='sections'></table><p style='padding-left:8px;'><span style="color: #909090">[Inferred type]</span> <a href="psi_element://java.lang.String"><code><span style="color:#0000ff;">String</span></code></a>'''
<div class='definition'><pre><a href="psi_element://java.lang.Object"><code><span style="color:#0000ff;">Object</span></code></a> <span style="color:#000000;">it</span></pre></div><p style='padding-left:8px;'><span style="color: #909090">[Inferred type]</span> <a href="psi_element://java.lang.String"><code><span style="color:#0000ff;">String</span></code></a>'''
}
void 'test code tag'() {