use of com.intellij.psi.impl.search.MethodTextOccurrenceProcessor in project intellij-community by JetBrains.
the class GrLiteralMethodSearcher method processQuery.
@Override
public void processQuery(@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor<PsiReference> consumer) {
final PsiMethod method = p.getMethod();
final PsiClass aClass = method.getContainingClass();
if (aClass == null)
return;
final String name = method.getName();
if (StringUtil.isEmpty(name))
return;
final boolean strictSignatureSearch = p.isStrictSignatureSearch();
final PsiMethod[] methods = strictSignatureSearch ? new PsiMethod[] { method } : aClass.findMethodsByName(name, false);
SearchScope accessScope = GroovyScopeUtil.getEffectiveScope(methods);
final SearchScope restrictedByAccess = GroovyScopeUtil.restrictScopeToGroovyFiles(p.getEffectiveSearchScope(), accessScope);
final String textToSearch = findLongestWord(name);
p.getOptimizer().searchWord(textToSearch, restrictedByAccess, UsageSearchContext.IN_STRINGS, true, method, new MethodTextOccurrenceProcessor(aClass, strictSignatureSearch, methods));
}
Aggregations