void (@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor<? super 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)); }