void (@NotNull GrCall call, PsiClassType type, @Nullable String argumentName, final Map<String, NamedArgumentDescriptor> result) { if (argumentName == null) { final HashMap<String, Trinity<PsiType, PsiElement, PsiSubstitutor>> map = new HashMap<>(); MyPsiScopeProcessor processor = new MyPsiScopeProcessor() { @Override protected void addNamedArgument(String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; Trinity<PsiType, PsiElement, PsiSubstitutor> pair = map.get(propertyName); if (pair != null) { if (element instanceof PsiMethod && pair.second instanceof PsiField) { // methods should override fields } else { return; } } map.put(propertyName, Trinity.create(type, element, substitutor)); } }; processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_METHOD_PROPERTY); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); for (Map.Entry<String, Trinity<PsiType, PsiElement, PsiSubstitutor>> entry : map.entrySet()) { result.put(entry.getKey(), new TypeCondition( entry.getValue().first, entry.getValue().getSecond(), entry.getValue().getThird(), NamedArgumentDescriptor.Priority.AS_LOCAL_VARIABLE )); } } else { MyPsiScopeProcessor processor = new MyPsiScopeProcessor() { @Override protected void addNamedArgument(String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; result.put(propertyName, new TypeCondition(type, element, substitutor, NamedArgumentDescriptor.Priority.AS_LOCAL_VARIABLE)); } }; processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_METHOD); processor.setNameHint(GroovyPropertyUtils.getSetterName(argumentName)); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_PROPERTY); processor.setNameHint(argumentName); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); } }