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

    Pyodide kernel client for native VS Code notebooks. Uses Pyodide npm package for Node.js environment. Implements sequential execution queue matching Jupyter semantics.

    Index

    Constructors

    Properties

    _currentMsgId: number = null
    _executionQueue: QueuedExecution[] = []
    _isExecuting: boolean = false
    _isReady: boolean = false
    _lastDisplayData: { dataHash: string; msgId: number } = null
    _messageId: number = 0
    _pendingExecutions: Map<number, PendingExecution> = ...
    _pyodide: PyodideInterface = null

    Accessors

    Methods

    • Handles display_data messages (matplotlib plots, widgets, etc.). This is called when IPython's display() or when matplotlib creates plots.

      Parameters

      • msgId: number
      • data: Record<string, unknown>
      • Optionalmetadata: Record<string, unknown>

      Returns void

    • Handles error messages (exceptions, tracebacks). Formats Python tracebacks in Jupyter style without JavaScript stack traces.

      Parameters

      • msgId: number
      • error: unknown

      Returns void

    • Handles error messages from IPython shell with clean, pre-formatted tracebacks. IPython automatically filters out internal Pyodide frames, providing clean Python-only tracebacks.

      Parameters

      • msgId: number

        Execution message ID

      • ename: string

        Error name (e.g., "SyntaxError", "NameError")

      • evalue: string

        Error message

      • traceback: string[]

        Pre-formatted traceback lines from IPython (already clean!)

      Returns void

    • Pre-downloads Python packages from VS Code configuration. Uses micropip to install packages, which caches them for faster subsequent loads. Runs silently in the background - errors are logged but don't block initialization.

      Returns Promise<void>

    • Sets up IPython callbacks for capturing formatted output and clean error tracebacks. This ensures errors don't contain internal Pyodide stack frames.

      Returns Promise<void>

    • Executes Python code in a notebook cell. Queues execution for sequential processing.

      Parameters

      • code: string

        Python code to execute

      • execution: NotebookCellExecution

        VS Code notebook cell execution context

      Returns Promise<void>

      If Python code execution fails

    • Initializes the Pyodide kernel by loading the runtime. Uses bundled Pyodide from npm package (v0.29.0). Pre-downloads packages from VS Code configuration. Must be called before executing any code.

      Returns Promise<void>

      If initialization fails