Represents an immutable snapshot of a script at a specified time.Once acquired, the snapshot is observably immutable. i.e. the same calls with the same parameters will return the same values.
Methods
M getChangeRange(oldSnapshot: ts.IScriptSnapshot) ts.TextChangeRange
Gets the TextChangeRange that describe how the text changed between this text and an older version. This information is used by the incremental parser to determine what sections of the script need to be re-parsed. 'undefined' can be returned if the change range cannot be determined. However, in that case, incremental parsing will not happen and the entire document will be re - parsed.
Parameters:
Name | Type |
---|---|
oldSnapshot |
ts.IScriptSnapshot |
This call returns the array containing the start position of every line. i.e."[0, 10, 55]". TODO: consider making this optional. The language service could always determine this (albeit in a more expensive manner).
Gets a portion of the script snapshot specified by [start, end).
Parameters:
Name | Type |
---|---|
start |
number |
end |
number |