TextRange (GrImportStatement unusedImport) { final TextRange range = unusedImport.getTextRange(); if (StringUtil.isEmptyOrSpaces(unusedImport.getAnnotationList().getText())) return range; int start = 0; for (PsiElement child = unusedImport.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNode().getElementType() == GroovyTokenTypes.kIMPORT) { start = child.getTextRange().getStartOffset(); } } return new TextRange(start, range.getEndOffset()); }