TextRange (ExtractInfoHelper helper) { final StringPartInfo stringPartInfo = helper.getStringPartInfo(); if (stringPartInfo != null) { return stringPartInfo.getRange(); } else { final GrStatement[] statements = helper.getStatements(); int start = statements[0].getTextRange().getStartOffset(); int end = statements[statements.length - 1].getTextRange().getEndOffset(); return new TextRange(start, end); } }