Optional ReadonlyautosaveableReadonlydirtyReadonlylanguageThe identifier of the language associated with this document.
ReadonlylineThe number of lines in this document.
ReadonlyonThis 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.
ReadonlyonThis event is fired when the content of the dirty variable changes.
ReadonlyuriThe 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.
ReadonlyversionThe version number of this document (it will increase after each change, including undo/redo).
OptionalapplyApplies the given snapshot to the dirty state.
OptionalcreateCreates a snapshot of the dirty state. See also Saveable.Snapshot.
Dispose this object.
OptionalfiltersOptionally 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.
Optionalfind1-based
1-based
Get the text of this document. A substring can be retrieved by providing a range.
Optionalrange: 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.
OptionalrevertOptionalsavePerforms the save operation with a new file name.
OptionalserializeSerializes 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.