Readonly
eolThe end of line sequence that is predominately used in this document.
Readonly
fileThe file system path of the associated resource. Shorthand notation for TextDocument.uri.fsPath. Independent of the uri scheme.
Readonly
istrue
if the document have been closed. A closed document isn't synchronized anymore
and won't be re-used when the same resource is opened again.
Readonly
istrue
if there are unpersisted changes.
Readonly
isIs this document representing an untitled file which has never been saved yet. Note that
this does not mean the document will be saved to disk, use uri.scheme
to figure out where a document will be saved, e.g. file
, ftp
etc.
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.
Note that most documents use the file
-scheme, which means they are files on disk. However, not all documents are
saved on disk and therefore the scheme
must be checked before trying to access the underlying file or siblings on disk.
Readonly
versionThe version number of this document (it will strictly increase after each change, including undo/redo).
Get a word-range at the given position. By default words are defined by common separators, like space, -, _, etc. In addition, per language custom word definitions can be defined. It is also possible to provide a custom regular expression.
TextLine.text
for more complex, non-wordy, scenarios.The position will be adjusted.
A position.
Optional
regex: RegExpOptional regular expression that describes what a word is.
A range spanning a word, or undefined
.
Returns a text line denoted by the line number. Note that the returned object is not live and changes to the document are not reflected.
A line number in [0, lineCount).
A line.
Returns a text line denoted by the position. Note that the returned object is not live and changes to the document are not reflected.
The position will be adjusted.
A position.
A line.
Represents a text document, such as a source file. Text documents have lines and knowledge about an underlying resource like a file.