TextRange (GrVariable variable) { GrTypeElement typeElement = variable.getTypeElementGroovy(); if (typeElement == null) return null; PsiElement sibling = typeElement.getNextSibling(); if (sibling != null && sibling.getNode().getElementType() == GroovyTokenTypes.mTRIPLE_DOT) { return new TextRange(typeElement.getTextRange().getStartOffset(), sibling.getTextRange().getEndOffset()); } return typeElement.getTextRange(); }