Readonly
languageThe identifier of the language associated with this document.
Readonly
lineThe number of lines in this document.
Readonly
uriThe associated URI for this document. Most documents have the file-scheme, indicating that they represent files on disk. However, some documents may have other schemes indicating that they are not available on disk.
Readonly
versionThe version number of this document (it will increase after each change, including undo/redo).
Get the text of this document. A substring can be retrieved by providing a range.
Optional
range: Range(optional) An range within the document to return. If no range is passed, the full content is returned. Invalid range positions are adjusted as described in Position.line and Position.character. If the start range position is greater than the end range position, then the effect of getText is as if the two positions were swapped.
The text of this document or a substring of the text if a range is provided.
Converts a zero-based offset to a position.
A zero-based offset.
A valid Position position.
The text document "ab\ncd" produces:
* position { line: 0, character: 0 } for `offset` 0.
* position { line: 0, character: 1 } for `offset` 1.
* position { line: 0, character: 2 } for `offset` 2.
* position { line: 1, character: 0 } for `offset` 3.
* position { line: 1, character: 1 } for `offset` 4.
A simple text document. Not to be implemented. The document keeps the content as string.