mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
javadoc generation: base class for anonymous (IDEA-132362)
This commit is contained in:
@@ -1998,6 +1998,10 @@ public class JavaDocInfoGenerator {
|
||||
if (aClass == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (aClass instanceof PsiAnonymousClass) {
|
||||
return searchDocTagInSupers(new PsiClassType[] {((PsiAnonymousClass)aClass).getBaseClassType()}, aMethod, loc, visitedClasses);
|
||||
}
|
||||
|
||||
PsiClassType[] implementsTypes = aClass.getImplementsListTypes();
|
||||
Pair<T, InheritDocProvider<T>> tag = searchDocTagInSupers(implementsTypes, aMethod, loc, visitedClasses);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><PRE>
|
||||
public void <b>foo</b>()</PRE><DD><DL><DT><b>Description copied from interface:</b> <a href="psi_element://Foo"><code>Foo</code></a><br>
|
||||
some javadoc
|
||||
</DD></DL></DD><DD><DL><DT><b>Specified by:</b><DD><a href="psi_element://Foo#foo()"><code>foo</code></a> in interface <a href="psi_element://Foo"><code>Foo</code></a></DD></DL></DD></body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
class Bar {
|
||||
public static void main(String[] args) {
|
||||
new Foo() {
|
||||
@Override
|
||||
public void foo() {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
/**
|
||||
* some javadoc
|
||||
*/
|
||||
void foo();
|
||||
|
||||
}
|
||||
+10
@@ -21,6 +21,7 @@ import com.intellij.lang.java.JavaDocumentationProvider;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -49,6 +50,15 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
public void testMethodTypeParameter() throws Exception {
|
||||
doTestMethod();
|
||||
}
|
||||
|
||||
public void testAnonymousAndSuperJavadoc() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
assertNotNull(psiClass);
|
||||
psiClass = PsiTreeUtil.findChildOfType(psiClass, PsiAnonymousClass.class);
|
||||
assertNotNull(psiClass);
|
||||
PsiMethod method = psiClass.getMethods() [0];
|
||||
verifyJavaDoc(method);
|
||||
}
|
||||
|
||||
public void testInheritedDocInThrows() throws Exception {
|
||||
doTestMethod();
|
||||
|
||||
Reference in New Issue
Block a user