void (final @NotNull ASTNode node, final @NotNull List<? super FoldingDescriptor> descriptors) { final Queue<ASTNode> toProcess = new LinkedList<>(); toProcess.add(node); while (!toProcess.isEmpty()) { final ASTNode current = toProcess.remove(); if (current.getTreeParent() != null && current.getTextLength() > 1 && myTokenSet.contains(current.getElementType())) { descriptors.add(new FoldingDescriptor(current, current.getTextRange())); } for (ASTNode child = current.getFirstChildNode(); child != null; child = child.getTreeNext()) { toProcess.add(child); } } }