TextRange () { final PsiElement refNameElement = getReferenceNameElement(); if (refNameElement != null) { final int offsetInParent = refNameElement.getStartOffsetInParent(); return new TextRange(offsetInParent, offsetInParent + refNameElement.getTextLength()); } return new TextRange(0, getTextLength()); }