Search in sources :

Example 11 with MethodSignatureBackedByPsiMethod

use of com.intellij.psi.util.MethodSignatureBackedByPsiMethod in project intellij-community by JetBrains.

the class MethodSuperSearcher method execute.

@Override
public boolean execute(@NotNull final SuperMethodsSearch.SearchParameters queryParameters, @NotNull final Processor<MethodSignatureBackedByPsiMethod> consumer) {
    final PsiClass parentClass = queryParameters.getPsiClass();
    final PsiMethod method = queryParameters.getMethod();
    return ApplicationManager.getApplication().runReadAction((Computable<Boolean>) () -> {
        HierarchicalMethodSignature signature = method.getHierarchicalMethodSignature();
        final boolean checkBases = queryParameters.isCheckBases();
        final boolean allowStaticMethod = queryParameters.isAllowStaticMethod();
        final List<HierarchicalMethodSignature> supers = signature.getSuperSignatures();
        for (HierarchicalMethodSignature superSignature : supers) {
            if (MethodSignatureUtil.isSubsignature(superSignature, signature)) {
                if (!addSuperMethods(superSignature, method, parentClass, allowStaticMethod, checkBases, consumer))
                    return false;
            }
        }
        return true;
    });
}
Also used : MethodSignatureBackedByPsiMethod(com.intellij.psi.util.MethodSignatureBackedByPsiMethod) List(java.util.List)

Aggregations

MethodSignatureBackedByPsiMethod (com.intellij.psi.util.MethodSignatureBackedByPsiMethod)11 Document (com.intellij.openapi.editor.Document)2 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)2 MethodSignature (com.intellij.psi.util.MethodSignature)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Nullable (org.jetbrains.annotations.Nullable)2 GrMethod (org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod)2 LineMarkerInfo (com.intellij.codeInsight.daemon.LineMarkerInfo)1 MarkerType (com.intellij.codeInsight.daemon.impl.MarkerType)1 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 Project (com.intellij.openapi.project.Project)1 TextRange (com.intellij.openapi.util.TextRange)1 com.intellij.psi (com.intellij.psi)1 PsiElement (com.intellij.psi.PsiElement)1 PsiMethod (com.intellij.psi.PsiMethod)1 ArrangementSettingsToken (com.intellij.psi.codeStyle.arrangement.std.ArrangementSettingsToken)1 SuperMethodsSearch (com.intellij.psi.search.searches.SuperMethodsSearch)1 TypeConversionUtil (com.intellij.psi.util.TypeConversionUtil)1 Processor (com.intellij.util.Processor)1