Protected_Collection of child disposables to clean up.
ReadonlyonEvent fired when document state changes. Indicates document is dirty or collaborative sync occurred.
ReadonlyonEvent fired when document content changes. VS Code CustomDocument interface compliance.
ReadonlyonEvent fired when document is disposed. VS Code CustomDocument interface compliance.
Gets the current document content as binary data.
Binary representation of the document content.
Whether the document has unsaved changes.
In collaborative mode, this always returns false since changes are automatically synchronized to the platform.
True if document has unsaved changes, false otherwise.
ProtectedisGets whether this instance has been disposed.
True if disposed, false otherwise.
Gets the document's URI.
The VS Code URI identifying this document.
Protected_Creates a backup of the document.
Saves the current document state to a backup location and returns a backup descriptor that can be used for restoration.
URI for the backup location.
Cancellation token for aborting the backup operation.
Promise resolving to backup descriptor with delete callback.
Disposes of the document and releases all associated resources.
Fires disposal events and calls the parent disposable cleanup. Should be called when the document is no longer needed.
Records an edit operation on the document.
In non-collaborative mode, marks the document as dirty and fires change events. In collaborative mode, only fires change events since the document state is managed externally.
The edit operation data (currently unused).
Reverts the document to its last saved state.
Reloads content from disk, clears the dirty state, and notifies listeners of the content change.
Cancellation token (currently unused).
Saves the document to its original location.
In collaborative mode, this operation is a no-op since changes are automatically synchronized. Otherwise, retrieves current content from the webview and writes it to the file system.
Cancellation token for aborting the save operation.
Saves the document to a new location.
Retrieves current content from the webview and writes it to the specified target location. Does not change the document's original URI.
URI where to save the document.
Cancellation token for aborting the save operation.
Sets the collaborative mode for this document.
When collaborative mode is enabled, the document becomes read-only and changes are automatically synchronized to the Datalayer platform. The dirty state is cleared when entering collaborative mode.
Whether to enable collaborative mode.
StaticcreateCreates a new LexicalDocument instance from a URI.
Handles both regular files and backup scenarios. For backup restoration, the backupId parameter should contain the backup file URI.
The document URI to open.
Optional backup ID for document restoration.
Delegate providing webview content retrieval capabilities.
Promise resolving to the created document instance.
Represents a lexical document in VS Code custom editor. Manages document lifecycle, content state, and collaboration features.
This class implements the VS Code CustomDocument interface to provide document management for Datalayer's lexical editor integration.