BitSet (@NotNull PsiElement valueElement, int indexesOffset) { return StreamEx.of(valueElement.getChildren()) .filter(child -> !(child instanceof LeafPsiElement)) .map(PsiElement::getTextRange) .flatMapToInt(range -> IntStream.range(range.getStartOffset(), range.getEndOffset())) .map(index -> index - indexesOffset) .atLeast(0) .toBitSet(); }