Skip to content

projectDecorationRangeThroughEdits

projectDecorationRangeThroughEdits(range, edits): EditorDecorationRange | null

Moves a range through a batch of edits, each endpoint following its own bias.

Returns null once the range has lost all of its width: a decoration that described a span of text has nothing left to say when that text is gone. A range registered empty stays empty and keeps its place.

Edits address the document as it stood before any of them applied, which is how a transaction reports them, so each one is shifted by the length change of the edits already folded in.

EditorDecorationRange

readonly TextEdit[]

EditorDecorationRange | null