ElementsRange () { if (myStart == null || myEnd == null) { return null; } PsiElement start = myStart.getElement(); if (myStart == myEnd) { return start != null ? new ElementsRange(start, start) : null; } PsiElement end = myEnd.getElement(); if (start == null || end == null) { return null; } return new ElementsRange(start, end); }