mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not search for lambda parameter javadoc
This commit is contained in:
@@ -854,13 +854,13 @@ public class JavaDocInfoGenerator {
|
||||
buffer.append("</b>");
|
||||
buffer.append("</PRE>");
|
||||
|
||||
final PsiMethod method = PsiTreeUtil.getParentOfType(parameter, PsiMethod.class);
|
||||
final PsiElement method = PsiTreeUtil.getParentOfType(parameter, PsiMethod.class, PsiLambdaExpression.class);
|
||||
|
||||
if (method != null) {
|
||||
final PsiDocComment docComment = getDocComment(method);
|
||||
if (method instanceof PsiMethod) {
|
||||
final PsiDocComment docComment = getDocComment((PsiMethod)method);
|
||||
if (docComment != null) {
|
||||
final Pair<PsiDocTag, InheritDocProvider<PsiDocTag>> tagInfoProvider =
|
||||
findDocTag(docComment.getTags(), parameter.getName(), method);
|
||||
findDocTag(docComment.getTags(), parameter.getName(), (PsiMethod)method);
|
||||
|
||||
if (tagInfoProvider != null) {
|
||||
PsiElement[] elements = tagInfoProvider.first.getDataElements();
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><PRE>int <b>a</b></PRE></body></html>
|
||||
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
interface I {
|
||||
String m(int a);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param a not my wrong javadoc
|
||||
*/
|
||||
public String getY() {
|
||||
I i = (a) -> {
|
||||
return null;
|
||||
};
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -165,6 +165,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
assertEquals(exampleHtmlFileText(getTestName(true)), StringUtil.convertLineSeparators(docInfo.trim()));
|
||||
}
|
||||
|
||||
public void testLambdaParameter() throws Exception {
|
||||
doTestLamabdaParameter();
|
||||
}
|
||||
|
||||
private void doTestField() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
PsiField field = psiClass.getFields() [0];
|
||||
@@ -177,6 +181,13 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
verifyJavaDoc(method);
|
||||
}
|
||||
|
||||
private void doTestLamabdaParameter() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
final PsiLambdaExpression lambdaExpression = PsiTreeUtil.findChildOfType(psiClass, PsiLambdaExpression.class);
|
||||
assertNotNull(lambdaExpression);
|
||||
verifyJavaDoc(lambdaExpression.getParameterList().getParameters()[0]);
|
||||
}
|
||||
|
||||
private PsiClass getTestClass() throws Exception{
|
||||
configureByFile("/codeInsight/javadocIG/" + getTestName(true) + ".java");
|
||||
return ((PsiJavaFile)myFile).getClasses() [0];
|
||||
|
||||
Reference in New Issue
Block a user