List<TextRange> () { final int myStart = getTextRange().getStartOffset(); final List<TextRange> result = new ArrayList<>(); boolean seenText = false; for (ASTNode child = getFirstContentNode(); child != null; child = child.getTreeNext()) { if (child.getElementType() == YAMLTokenTypes.TEXT) { seenText = true; result.add(child.getTextRange().shiftRight(-myStart)); } else if (child.getElementType() == YAMLTokenTypes.EOL) { if (!seenText) { result.add(child.getTextRange().shiftRight(-myStart)); } seenText = false; } } return result; }