Constructors

C new TextChangeRange(span: ts.TextSpan, newLength: number) void

Initializes a new instance of TextChangeRange.

Parameters:
Name Type
span ts.TextSpan
newLength number

Properties

P _newLength

P _span

Methods

M collapseChangesAcrossMultipleVersions(changes: ts.TextChangeRange[]) ts.TextChangeRange

Called to merge all the changes that occurred across several versions of a script snapshot into a single change. i.e. if a user keeps making successive edits to a script we will have a text change from V1 to V2, V2 to V3, ..., Vn.

This function will then merge those changes into a single change range valid between V1 and Vn.

Parameters:
Name Type
changes Array.<ts.TextChangeRange>
Returns: { ts.TextChangeRange }

M isUnchanged() boolean

Returns: { boolean }

M newLength() number

Width of the span after the edit. A 0 here would represent a delete

Returns: { number }

M newSpan() ts.TextSpan

Returns: { ts.TextSpan }

M span() ts.TextSpan

The span of text before the edit which is being changed

Returns: { ts.TextSpan }