ReadonlylanguageThe document's language id, e.g. 'typescript'.
ReadonlylineNumber of lines. Always at least 1.
ReadonlyselectionsThe current selections, primary first. Never empty.
Each is ordered: start never comes after end, even for a right-to-left
selection, matching vscode.Selection.start/end. The direction the user
dragged in is not something a text operation should have to think about.
ReadonlyuriThe document's location. untitled: documents have no meaningful path.
Applies replacements. Resolves false when the platform refused them.
An empty batch with an explicit undoStop places that boundary and
changes nothing else — which is how a sequence of batches closes its undo
step once the last one turns out to have been the last. With no explicit
undoStop an empty batch is simply nothing to do.
Optionaloptions: TextEditOptionsThe span of a whole line, or undefined when the line does not exist.
Replaces the selections. The first becomes primary.
The span of the word at a position, using the platform's own word
definition unless pattern overrides it. Undefined when there is no word.
Optionalpattern: RegExp
The editor the user is working in, as the framework sees it.
Reads are pull-based rather than a snapshot: a handler can edit and then read back, and the document may also change underneath it.