PsiReferenceExpression (@NotNull ControlFlow flow, @NotNull PsiElement element, @NotNull PsiVariable variable) { int readOffset = findSingleReadOffset(flow, flow.getStartOffset(element), flow.getEndOffset(element), variable); if (readOffset >= 0) { PsiElement readElement = flow.getElement(readOffset); readElement = PsiTreeUtil.findFirstParent(readElement, false, e -> e == element || e instanceof PsiReferenceExpression); if (readElement instanceof PsiReferenceExpression) { return (PsiReferenceExpression)readElement; } } return null; }