void (@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor<? super PsiReference> consumer) { final PsiElement element = queryParameters.getElementToSearch(); if (element instanceof PsiMethod) { final String propertyName = GroovyPropertyUtils.getPropertyName((PsiMethod)element); if (propertyName == null) return; SearchScope scope = GroovyScopeUtil.restrictScopeToGroovyFiles(queryParameters.getEffectiveSearchScope()); queryParameters.getOptimizer().searchWord(propertyName, scope, UsageSearchContext.IN_CODE, true, element); } else if (element instanceof GrField) { for (GrAccessorMethod method : ((GrField)element).getGetters()) { MethodReferencesSearch.search(method, queryParameters.getEffectiveSearchScope(), true).forEach(consumer); } final GrAccessorMethod setter = ((GrField)element).getSetter(); if (setter != null) { MethodReferencesSearch.search(setter, queryParameters.getEffectiveSearchScope(), true).forEach(consumer); } } }