TextRange (@NotNull final PyReferenceExpression element) { final ASTNode nameElement = element.getNameElement(); final int startOffset = nameElement != null ? nameElement.getStartOffset() : element.getTextRange().getEndOffset(); return new TextRange(startOffset - element.getTextOffset(), element.getTextLength()); }