childrenDepthFirst

fun PsiElement.childrenDepthFirst(): Sequence<PsiElement>(source)

Return

a sequence of child nodes of this PsiElement in depth-first order. The sequence starts with the first child node of this PsiElement, followed by the first child node of the first child node, and so on.


inline fun PsiElement.childrenDepthFirst(crossinline predicate: (PsiElement) -> Boolean): Sequence<PsiElement>(source)

Return

a sequence of child nodes of this PsiElement in depth-first order that satisfy the given predicate. The sequence starts with the first child node of this PsiElement, followed by the first child node of the first child node, and so on.

Parameters

predicate

stops visiting child nodes of the given node once this predicate returns false