Creates a new NotebookProvider.
Extension context for resource access
Protected Readonly_Protected Readonly_Protected Readonly_Protected Readonly_Event emitter for document changes. Subclasses should fire this event when documents change.
Protected Readonly_ReadonlyonEvent for document changes (required by CustomEditorProvider interface).
Private ReadonlywebviewsTracks all known webviews
Private StaticnewPrivate Static ReadonlyviewCreates a backup of a custom document.
Document to backup
Backup context with destination
Cancellation token
Promise resolving to backup descriptor
ProtectedgetGets the URI for a notebook document.
The notebook document
The document URI
PrivategetGet the static HTML used for the editor's webviews.
The webview instance
HTML content for the webview
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
Opens a custom document for the notebook editor.
Document URI to open
Context including backup information
Cancellation token
Promise resolving to the notebook 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 notebook-specific message handlers. Overrides base class to add notebook content change handler.
Resolves a custom editor by setting up the webview and initializing communication.
The notebook document to display
The webview panel for the editor
Cancellation token
Promise that resolves when editor is ready
Reverts a custom document to its saved state.
Document to revert
Cancellation token
Promise that resolves when revert is complete
Saves a custom document.
Document to save
Cancellation token
Promise that resolves when save is complete
Saves a custom document to a new location.
Document to save
Target URI for saving
Cancellation token
Promise that resolves when save is complete
PrivateshowShows the Datalayer runtime selector dialog. Helper method to avoid code duplication.
The notebook document
StaticregisterRegisters the notebook editor provider and commands.
Extension context for resource management
Disposable for cleanup
Custom editor provider for Jupyter notebooks with dual-mode support. Handles both local file-based notebooks and collaborative Datalayer notebooks with runtime management, webview communication, and real-time synchronization.