mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method hierarchy: search functional expressions by current method only (IDEA-124320); navigation (IDEA-124319)
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ public final class MethodHierarchyNodeDescriptor extends HierarchyNodeDescriptor
|
||||
myTreeStructure = treeStructure;
|
||||
}
|
||||
|
||||
private PsiMethod getMethod(final PsiClass aClass, final boolean checkBases) {
|
||||
PsiMethod getMethod(final PsiClass aClass, final boolean checkBases) {
|
||||
return MethodHierarchyUtil.findBaseMethodInClass(myTreeStructure.getBaseMethod(), aClass, checkBases);
|
||||
}
|
||||
|
||||
|
||||
+10
-7
@@ -172,13 +172,16 @@ public final class MethodHierarchyTreeStructure extends HierarchyTreeStructure {
|
||||
descriptors.add(d);
|
||||
}
|
||||
|
||||
FunctionalExpressionSearch.search(getBaseMethod()).forEach(new Processor<PsiFunctionalExpression>() {
|
||||
@Override
|
||||
public boolean process(PsiFunctionalExpression expression) {
|
||||
descriptors.add(new MethodHierarchyNodeDescriptor(myProject, descriptor, expression, false, MethodHierarchyTreeStructure.this));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
final PsiMethod existingMethod = ((MethodHierarchyNodeDescriptor)descriptor).getMethod(psiClass, false);
|
||||
if (existingMethod != null) {
|
||||
FunctionalExpressionSearch.search(existingMethod).forEach(new Processor<PsiFunctionalExpression>() {
|
||||
@Override
|
||||
public boolean process(PsiFunctionalExpression expression) {
|
||||
descriptors.add(new MethodHierarchyNodeDescriptor(myProject, descriptor, expression, false, MethodHierarchyTreeStructure.this));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return descriptors.toArray(new HierarchyNodeDescriptor[descriptors.size()]);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.intellij.psi;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface PsiFunctionalExpression extends PsiExpression, Iconable {
|
||||
public interface PsiFunctionalExpression extends PsiExpression, Iconable, NavigatablePsiElement {
|
||||
/**
|
||||
* @return SAM type the lambda expression corresponds to
|
||||
* null when no SAM type could be found
|
||||
|
||||
Reference in New Issue
Block a user