TextRange () { PsiExpression[] operands = myExpression.getOperands(); if (operands.length > myLastOperand + 1) { return new TextRange(0, operands[myLastOperand].getStartOffsetInParent() + operands[myLastOperand].getTextLength()); } throw new IllegalStateException("Not enough operands"); }