Skip to content

PsiChildRange

data class PsiChildRange(val first: PsiElement?, val last: PsiElement?) : Sequence<PsiElement> 

A contiguous range of sibling PSI elements, from first to last inclusive, iterable as a Sequence.

Both endpoints must share the same parent. A range is empty when first is null (in which case last is null too); otherwise it always contains at least first.

Constructors

PsiChildRange

constructor(first: PsiElement?, last: PsiElement?)

Types

Companion

object Companion

Properties

first

val first: PsiElement?

isEmpty

true if this range contains no elements.

last

val last: PsiElement?

textRange

val PsiChildRange.textRange: TextRange?

The text range spanning this child range, or null if the range is empty.

Functions

getText

Returns the concatenated text of all elements in this range, or an empty string if the range is empty.

iterator

open operator override fun iterator(): Iterator<PsiElement>

trimWhiteSpaces

Returns a copy of this range with leading and trailing whitespace elements removed.