SliceUsage (SliceUsage parent, PsiMethod method) { while (parent != null) { PsiElement element = parent.getElement(); if (element instanceof PsiCall && method.getManager().areElementsEquivalent(((PsiCall)element).resolveMethod(), method)) { return parent; } parent = parent.getParent(); } return null; }