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

    Manages notebook controllers with a main selector and runtime-specific controllers.

    Implements

    • Disposable
    Index

    Constructors

    Properties

    _activeKernels: Map<string, WebSocketKernelClient> = ...

    Map of notebook URIs to active WebSocket kernel clients

    _authProvider: SDKAuthProvider

    Authentication provider for managing auth state

    _context: ExtensionContext

    VS Code extension context for accessing API and managing subscriptions

    _controllers: Map<string, NotebookController> = ...

    Map of notebook controller IDs to VS Code NotebookController instances

    _disposed: boolean = false

    Flag to track if this manager has been disposed

    _executionOrder: number = 0

    Counter for execution order tracking across cells

    _kernelBridge: KernelBridge

    Bridge for managing kernel connections and webview communication

    _notebookRuntimes: Map<string, RuntimeDTO> = ...

    Map of notebook URIs to their selected runtimes

    _onRuntimeCreated: EventEmitter<RuntimeDTO> = ...

    Event emitter fired when a runtime is created or selected

    _pyodideKernels: Map<string, PyodideKernelClient> = ...

    Map of notebook URIs to active Pyodide kernel clients

    _runtimes: Map<string, RuntimeDTO> = ...

    Map of controller IDs to runtime DTOs for reverse lookup

    _sdk: DatalayerClient

    Datalayer SDK client for API communication

    _selectingRuntime: boolean = false

    Guard flag to prevent re-entry during runtime selection

    onRuntimeCreated: Event<RuntimeDTO> = ...

    Event that fires when a runtime is created or selected, allows tree view refresh

    Methods

    • Creates the main "Datalayer Platform" controller. This controller acts as an entry point for runtime selection. When selected, it immediately shows the runtime picker.

      Returns void

    • Creates the Pyodide controller for offline Python execution. This controller works with native .ipynb files without requiring server connectivity.

      Returns void

    • Executes cells with the specified runtime.

      Parameters

      • cells: NotebookCell[]

        Cells to execute

      • notebook: NotebookDocument

        The notebook document

      • runtime: RuntimeDTO

        The runtime to use

      • OptionalexecutingController: NotebookController

        The controller that is actually executing (might be Platform or Runtime controller)

      Returns Promise<void>

    • Executes cells using Pyodide kernel (browser-based Python). Creates kernel on-demand and reuses it for the notebook lifetime.

      Parameters

      • cells: NotebookCell[]

        Cells to execute

      • notebook: NotebookDocument

        Notebook document

      • controller: NotebookController

        Pyodide controller

      Returns Promise<void>

    • Gets the unique controller ID for a specific runtime.

      Parameters

      • runtime: RuntimeDTO

        The runtime DTO to get the controller ID for

      Returns string

      The unique controller identifier string

    • Refreshes all controllers based on current authentication and available runtimes. Creates controllers for existing runtimes that don't have controllers yet. Removes controllers for runtimes that no longer exist.

      Returns Promise<void>

    • Shows runtime selector dialog and returns the selected runtime. Prompts for login if not authenticated.

      Returns Promise<RuntimeDTO>

      The selected runtime DTO, or undefined if user cancels or not authenticated

    • Selects or switches a runtime for a specific notebook. This can be called anytime, even if Platform controller is already selected.

      Parameters

      • notebook: NotebookDocument

        The notebook to select runtime for

      Returns Promise<void>

    • Shows runtime selector and switches to selected runtime. This is the main method for switching runtimes.

      Parameters

      • notebook: NotebookDocument

      Returns Promise<void>