Optional
Readonly
autosaveableReadonly
dirtyReadonly
languageThe identifier of the language associated with this document.
Readonly
lineThe number of lines in this document.
Readonly
onThis event is fired when the content of the saveable changes.
While onDirtyChanged
is fired to notify the UI that the widget is dirty,
onContentChanged
is used for the auto save throttling.
Readonly
onThis event is fired when the content of the dirty
variable changes.
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).
Optional
applyApplies the given snapshot to the dirty state.
Optional
createCreates a snapshot of the dirty state. See also Saveable.Snapshot.
Dispose this object.
Optional
filtersOptionally return file filters for the "Save As" dialog.
The keys of the returned object are the names of the filters and the values are arrays of file extensions.
For example: { 'Text Files': ['txt', 'text'], 'All Files': ['*'] }
If no filters are provided, a default filter of All Files (*.*)
will be used.
Optional
find1-based
1-based
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 the position to a zero-based offset. Invalid positions are adjusted as described in Position.line and Position.character.
A position.
A valid zero-based offset.
Optional
revertOptional
savePerforms the save operation with a new file name.
Optional
serializeSerializes the full state of the saveable item to a binary buffer.
Creates a valid position. If the position is outside of the backing document, this method will return a position that is ensured to be inside the document and valid.
For example, when the position
is { line: 1, character: 0 }
and the document is empty, this method will return with { line: 0, character: 0 }
.
Creates a valid range. If the range
argument is outside of the document, this method will return with a new range that does not exceed the boundaries of the document.
For example, if the argument is { start: { line: 1, character: 0 }, end: { line: 1, character: 0 } }
and the document is empty, the return value is
{ start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }
.
If false, the saveable will not participate in autosaving.