mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
EJB method hierarchy shouldn't affect completion statistics (IDEA-117673)
This commit is contained in:
@@ -28,10 +28,11 @@ import com.intellij.psi.filters.ClassFilter;
|
||||
import com.intellij.psi.filters.ElementFilter;
|
||||
import com.intellij.psi.filters.element.ExcludeDeclaredFilter;
|
||||
import com.intellij.psi.filters.element.ExcludeSillyAssignment;
|
||||
import com.intellij.psi.impl.search.MethodDeepestSuperSearcher;
|
||||
import com.intellij.psi.scope.ElementClassFilter;
|
||||
import com.intellij.psi.search.searches.DeepestSuperMethodsSearch;
|
||||
import com.intellij.psi.util.PropertyUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.CommonProcessors;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -209,7 +210,9 @@ class RecursionWeigher extends LookupElementWeigher {
|
||||
|
||||
@NotNull
|
||||
public static PsiMethod findDeepestSuper(@NotNull final PsiMethod method) {
|
||||
final PsiMethod first = DeepestSuperMethodsSearch.search(method).findFirst();
|
||||
CommonProcessors.FindFirstProcessor<PsiMethod> processor = new CommonProcessors.FindFirstProcessor<PsiMethod>();
|
||||
MethodDeepestSuperSearcher.processDeepestSuperMethods(method, processor);
|
||||
final PsiMethod first = processor.getFoundValue();
|
||||
return first == null ? method : first;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ import java.util.Set;
|
||||
public class MethodDeepestSuperSearcher implements QueryExecutor<PsiMethod, PsiMethod> {
|
||||
@Override
|
||||
public boolean execute(@NotNull PsiMethod method, @NotNull Processor<PsiMethod> consumer) {
|
||||
return processDeepestSuperMethods(method, consumer);
|
||||
}
|
||||
|
||||
public static boolean processDeepestSuperMethods(PsiMethod method, Processor<PsiMethod> consumer) {
|
||||
final Set<PsiMethod> methods = new THashSet<PsiMethod>();
|
||||
methods.add(method);
|
||||
return findDeepestSuperOrSelfSignature(method, methods, null, consumer);
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.intellij.util.QueryExecutor;
|
||||
* @author max
|
||||
*/
|
||||
public class DeepestSuperMethodsSearch extends ExtensibleQueryFactory<PsiMethod, PsiMethod> {
|
||||
public static ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.deepestSuperMethodsSearch");
|
||||
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.deepestSuperMethodsSearch");
|
||||
public static final DeepestSuperMethodsSearch DEEPEST_SUPER_METHODS_SEARCH_INSTANCE = new DeepestSuperMethodsSearch();
|
||||
|
||||
private DeepestSuperMethodsSearch() {
|
||||
|
||||
Reference in New Issue
Block a user