boolean (PsiReference reference) { final PsiElement element = reference.getElement(); if (element instanceof PsiReferenceExpression) { PsiCallExpression parent = PsiTreeUtil.getParentOfType(element, PsiCallExpression.class); while (parent != null) { final PsiMethod resolved = parent.resolveMethod(); if (scope.equals(resolved)) { if (usedInQualifier(element, parent, scopeParamIdx)) return false; return true; } if (nodeMethod.equals(resolved)) { if (usedInQualifier(element, parent, parameterIndex)) return false; ref.set(true); return true; } parent = PsiTreeUtil.getParentOfType(parent, PsiCallExpression.class, true); } return false; } return true; }