mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
quick doc: fix class type params around <> (IDEA-113445)
This commit is contained in:
@@ -194,7 +194,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
if (aClass.hasTypeParameters()) {
|
||||
PsiTypeParameter[] parms = aClass.getTypeParameters();
|
||||
|
||||
buffer.append("<");
|
||||
buffer.append("<");
|
||||
|
||||
for (int i = 0; i < parms.length; i++) {
|
||||
PsiTypeParameter p = parms[i];
|
||||
@@ -220,7 +220,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
}
|
||||
|
||||
buffer.append(">");
|
||||
buffer.append(">");
|
||||
}
|
||||
|
||||
PsiClassType[] refs;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[< java 1.7 >] java.util
|
||||
public class java.util.ArrayList<E> extends java.util.AbstractList<E>
|
||||
implements java.util.List<E>, java.util.RandomAccess, java.lang.Cloneable, java.io.Serializable
|
||||
@@ -0,0 +1,2 @@
|
||||
import java.util.*;
|
||||
class A extends ArrayList<String> {}
|
||||
+12
@@ -82,6 +82,18 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
assertEquals(StringUtil.convertLineSeparators(htmlText.trim()), StringUtil.convertLineSeparators(docInfo.trim()));
|
||||
}
|
||||
|
||||
public void testClassTypeParamsPresentation() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
final PsiReferenceList extendsList = psiClass.getExtendsList();
|
||||
final PsiJavaCodeReferenceElement referenceElement = extendsList.getReferenceElements()[0];
|
||||
final PsiClass superClass = extendsList.getReferencedTypes()[0].resolve();
|
||||
final File htmlPath = new File(JavaTestUtil.getJavaTestDataPath() + "/codeInsight/javadocIG/" + getTestName(true) + ".html");
|
||||
String htmlText = FileUtil.loadFile(htmlPath);
|
||||
String docInfo = new JavaDocumentationProvider().getQuickNavigateInfo(superClass, referenceElement);
|
||||
assertNotNull(docInfo);
|
||||
assertEquals(StringUtil.convertLineSeparators(htmlText.trim()), StringUtil.convertLineSeparators(docInfo.trim()));
|
||||
}
|
||||
|
||||
private void doTestField() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
PsiField field = psiClass.getFields() [0];
|
||||
|
||||
Reference in New Issue
Block a user