AbstractThe document type (NotebookDocument or LexicalDocument).
Creates a new base document provider with message routing and bridge services.
The document type (NotebookDocument or LexicalDocument).
VS Code extension context providing access to storage and subscriptions.
Protected Readonly_Map of request ID to response callbacks for request/response message pattern.
Protected Readonly_VS Code extension context providing access to storage, subscriptions, etc.
Protected Readonly_Message router for handling webview messages and routing to appropriate handlers.
Protected Readonly_Network bridge service for HTTP/WebSocket communication between extension and webview.
Protected Readonly_Event emitter for document changes. Subclasses should fire this event when documents change.
Protected Readonly_Map of webview panels to their Runner instances. Runners handle tool execution via the BridgeExecutor pattern.
Protected Readonly_Runtime bridge service for managing runtime lifecycle and selection.
ReadonlyonEvent for document changes (required by CustomEditorProvider interface).
Creates a backup of the document for crash recovery. Default implementation throws since subclasses should override if needed.
The document instance to backup.
Backup context with destination URI.
Cancellation token for aborting the backup.
Promise resolving to backup descriptor with cleanup function.
Protected AbstractgetGets the URI for a document. Subclasses must implement this to extract the URI from their document type.
The document to extract the URI from.
The document URI identifying the file location.
ProtectedgetGets the Runner for a specific webview panel.
The webview panel to look up the runner for.
The Runner instance, or undefined if not initialized.
ProtectedinitializeInitializes a Runner for a webview panel. Subclasses should call this in their resolveCustomEditor implementation.
The Runner uses a BridgeExecutor to send tool execution requests to the webview, where they are executed by the webview's own Runner with DefaultExecutor.
The webview panel to create a Runner for.
The created Runner instance.
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 structured message from the webview.
AbstractopenOpens a custom document from the given URI. Subclasses must implement document creation logic.
File URI to open as a custom document.
Context containing optional backup ID for restoration.
Cancellation token for aborting the operation.
Promise resolving to the created document instance.
ProtectedpostPosts a message to the webview without expecting a response.
Target webview panel to send the message to.
Message type identifier for routing.
Message payload data.
Optionalid: stringOptional message identifier for tracking.
ProtectedpostPosts a message to the webview and waits for a response. Uses the request/response pattern with requestId tracking.
Target webview panel to send the message to.
Message type identifier for routing.
Message payload data.
Promise resolving to the webview response.
ProtectedregisterRegisters all message handlers with the message router. Called during constructor initialization. Subclasses can override to add custom handlers.
AbstractresolveResolves a custom editor by configuring the webview for a document. Subclasses must implement webview setup logic.
The document to display in the editor.
The webview panel to configure and populate.
Cancellation token for aborting the operation.
Promise that resolves when the editor is fully initialized.
Reverts the document to its last saved state on disk. Default implementation throws since subclasses should override if needed.
The document instance to revert.
Cancellation token for aborting the revert.
Promise that resolves when revert is complete.
Saves the document to its original location. Default implementation throws since subclasses should override if saving is supported.
The document instance to persist.
Cancellation token for aborting the save.
Promise that resolves when save is complete.
Saves the document to a new location. Default implementation throws since subclasses should override if needed.
The document instance to save.
Target URI for the saved copy.
Cancellation token for aborting the save.
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.