boolean (@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PsiMethod || element instanceof PsiField) { String propertyName; PsiType type; if (element instanceof PsiMethod method) { if (!myResolveTargetKinds.contains(DeclarationKind.METHOD)) return true; if (!GroovyPropertyUtils.isSimplePropertySetter(method)) return true; propertyName = GroovyPropertyUtils.getPropertyNameBySetter(method); if (propertyName == null) return true; type = method.getParameterList().getParameters()[0].getType(); } else { if (!myResolveTargetKinds.contains(DeclarationKind.FIELD)) return true; type = ((PsiField)element).getType(); propertyName = ((PsiField)element).getName(); } if (METACLASS.equals(propertyName)) return true; PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY); if (substitutor != null) { type = substitutor.substitute(type); } addNamedArgument(propertyName, type, element, substitutor); } return true; }