AbstractThe document type (NotebookDocument or LexicalDocument)
Creates a new base document provider.
Extension context
Private Readonly_Protected Readonly_Protected Readonly_Protected Readonly_Protected Readonly_Event emitter for document changes. Subclasses should fire this event when documents change.
Private_Protected Readonly_ReadonlyonEvent for document changes (required by CustomEditorProvider interface).
Backs up the document. Default implementation throws - subclasses should override if needed.
Document to backup
Backup context
Cancellation token
Promise resolving to backup information
Protected AbstractgetGets the URI for a document. Subclasses must implement this to extract the URI from their document type.
The document
The document URI
ProtectedonHandles messages received from the webview. Delegates to the message router for all message types.
The webview panel that sent the message
The document associated with the webview
The message from the webview
AbstractopenOpens a custom document. Subclasses must implement document creation logic.
Document URI
Open context with backup information
Cancellation token
Promise resolving to the document
ProtectedpostPosts a message to the webview without expecting a response.
Target webview panel
Message type
Message body
Optionalid: stringOptional message ID
ProtectedpostPosts a message to the webview and waits for a response. Uses the request/response pattern with requestId tracking.
Target webview panel
Message type
Message body
Promise resolving to the response
ProtectedregisterRegisters all message handlers with the message router. Called during constructor initialization. Subclasses can override to add custom handlers.
AbstractresolveResolves a custom editor for a document. Subclasses must implement webview setup logic.
The document to display
The webview panel to use
Cancellation token
Promise that resolves when editor is ready
Reverts the document to its saved state. Default implementation throws - subclasses should override if needed.
Document to revert
Cancellation token
Promise that resolves when revert is complete
Saves the document. Default implementation throws - subclasses should override if saving is supported.
Document to save
Cancellation token
Promise that resolves when save is complete
Saves the document to a new location. Default implementation throws - subclasses should override if needed.
Document to save
Destination URI
Cancellation token
Promise that resolves when save is complete
Abstract base class for document providers. Handles common provider patterns including webview lifecycle, message routing, and request/response.