Datalayer VS Code Extension - v0.0.17
    Preparing search index...

    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.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _callbacks: Map<string | number, (response: unknown) => void> = ...

    Map of request ID to response callbacks for request/response message pattern.

    _context: ExtensionContext

    VS Code extension context providing access to storage, subscriptions, etc.

    _messageRouter: DocumentMessageRouter

    Message router for handling webview messages and routing to appropriate handlers.

    _networkBridge: NetworkBridgeService

    Network bridge service for HTTP/WebSocket communication between extension and webview.

    _onDidChangeCustomDocument: EventEmitter<
        CustomDocumentEditEvent<NotebookDocument>,
    > = ...

    Event emitter for document changes. Subclasses should fire this event when documents change.

    _runners: Map<WebviewPanel, Runner> = ...

    Map of webview panels to their Runner instances. Runners handle tool execution via the BridgeExecutor pattern.

    _runtimeBridge: RuntimeBridgeService

    Runtime bridge service for managing runtime lifecycle and selection.

    onDidChangeCustomDocument: Event<CustomDocumentEditEvent<NotebookDocument>> = ...

    Event for document changes (required by CustomEditorProvider interface).

    Methods

    • Creates a backup of a custom document for crash recovery.

      Parameters

      • document: NotebookDocument

        Notebook document to backup.

      • context: CustomDocumentBackupContext

        Backup context with destination URI.

      • cancellation: CancellationToken

        Cancellation token for aborting the backup.

      Returns Thenable<CustomDocumentBackup>

      Promise resolving to backup descriptor with cleanup function.

    • Initializes 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.

      Parameters

      • webviewPanel: WebviewPanel

        The webview panel to create a Runner for.

      Returns Promise<Runner>

      The created Runner instance.

    • Opens a custom document for the notebook editor.

      Parameters

      • uri: Uri

        Document URI to open.

      • openContext: { backupId?: string }

        Context including backup information.

        • OptionalbackupId?: string

          Optional backup identifier for restoration.

      • _token: CancellationToken

        Cancellation token for aborting the operation.

      Returns Promise<NotebookDocument>

      Promise resolving to the notebook document.

    • Posts a message to the webview without expecting a response.

      Parameters

      • panel: WebviewPanel

        Target webview panel to send the message to.

      • type: string

        Message type identifier for routing.

      • body: unknown

        Message payload data.

      • Optionalid: string

        Optional message identifier for tracking.

      Returns void

    • Posts a message to the webview and waits for a response. Uses the request/response pattern with requestId tracking.

      Type Parameters

      • R = unknown

      Parameters

      • panel: WebviewPanel

        Target webview panel to send the message to.

      • type: string

        Message type identifier for routing.

      • body: unknown

        Message payload data.

      Returns Promise<R>

      Promise resolving to the webview response.

    • Resolves a custom editor by setting up the webview and initializing communication.

      Parameters

      • document: NotebookDocument

        The notebook document to display.

      • webviewPanel: WebviewPanel

        The webview panel for the editor.

      • _token: CancellationToken

        Cancellation token for aborting the operation.

      Returns Promise<void>

      Promise that resolves when the editor is ready.

    • Sends a message to a webview panel and waits for a response. Uses the request/response pattern inherited from BaseDocumentProvider.

      Parameters

      • panel: WebviewPanel

        Webview panel to send the message to.

      • message: unknown

        Message to send including type and requestId.

      • requestId: string

        Request ID to match the response callback.

      Returns Promise<unknown>

      Promise resolving to the webview response.

    • Registers the notebook editor provider and commands.

      Parameters

      • context: ExtensionContext

        Extension context for resource management.

      Returns Disposable

      Disposable for cleanup.