UsageInfo () { if (myElementAnchors.length == 1) { final PsiElement element = myElementAnchors[0].retrieve(); if (element == null || !element.isValid()) return null; return new UsageInfo(element); } PsiElement parent = PsiTreeUtil.findCommonParent(getElements()); if (parent == null) return null; int offs = parent.getTextRange().getStartOffset(); final int startOffsetInParent = getStartOffset() - offs; final int endOffsetInParent = getEndOffset() - offs; if (startOffsetInParent < 0) return null; if (endOffsetInParent < startOffsetInParent) return null; return new UsageInfo(parent, startOffsetInParent, endOffsetInParent); }