void (@NotNull ReferencesSearch.SearchParameters parameters, @NotNull Processor<? super PsiReference> consumer) { final PsiElement target = parameters.getElementToSearch(); if (!(target instanceof PsiMember) || !(target instanceof PsiNamedElement)) return; final String name = ((PsiNamedElement)target).getName(); if (name == null || StringUtil.isEmptyOrSpaces(name)) return; final SearchScope onlyGroovy = GroovyScopeUtil.restrictScopeToGroovyFiles(parameters.getEffectiveSearchScope()); final SearchRequestCollector collector = parameters.getOptimizer(); final SearchSession session = collector.getSearchSession(); if (target instanceof PsiMethod method) { if (GroovyPropertyUtils.isSimplePropertyAccessor(method)) { final PsiField field = GroovyPropertyUtils.findFieldForAccessor(method, true); if (field != null) { final String propertyName = field.getName(); final MyProcessor processor = new MyProcessor(method, GroovyPropertyUtils.getAccessorPrefix(method), session); collector.searchWord(propertyName, onlyGroovy, UsageSearchContext.IN_CODE, true, method, processor); } } } collector.searchWord(name, onlyGroovy, UsageSearchContext.IN_CODE, true, target, new MyProcessor(target, null, session)); }