int[] () { List<Integer> result = new ArrayList<>(); int offset = 0; for (TokenInfo token : tokens) { if (token instanceof PsiToken pt && pt.kind == TokenKind.markup) { result.add(offset); } offset += token.length(); } return result.stream().mapToInt(i -> i).toArray(); }