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

    Client for local Python kernels using direct ZMQ communication. Works with environments that only have ipykernel installed (no jupyter-server needed).

    Index

    Constructors

    Properties

    _connectionFile: string

    Path to the kernel connection file

    _disposed: boolean = false

    Indicates whether this client has been disposed

    _documentUri?: Uri

    Optional document URI for setting kernel working directory

    _kernelInfo: NativeKernelInfo

    Kernel information including Python path and kernel spec

    _kernelProcess: ChildProcess

    The spawned kernel process

    _realKernel: IKernelConnection

    The JupyterLab kernel connection instance

    _restarting: boolean = false

    Indicates whether a restart is in progress

    Methods

    • Dispose of the kernel client and clean up resources.

      Note: For local kernels, we skip the shutdown() API call because:

      • Local kernels don't have a Jupyter server running
      • We use direct ZMQ connections, so shutdown() would fail with "Failed to parse URL"
      • We kill the kernel process directly with SIGTERM instead

      Returns void

    • Execute code on the kernel.

      Parameters

      • code: string

        The code to execute

      Returns Promise<void>

      Error if kernel not started

    • Get kernel information from the running kernel.

      Returns Promise<unknown>

      Kernel information object

      Error if kernel not started

    • Get the working directory for the kernel process.

      • For file URIs: Returns the parent directory of the file
      • For virtual URIs (datalayer://): Returns workspace root folder
      • If no URI or workspace: Returns undefined (uses process cwd)

      Returns string

      Absolute path to use as kernel working directory

    • Restart the kernel by killing the current process and starting a new one. If the client has been disposed, it will be re-initialized.

      Note: For local kernels, we skip the shutdown() API call because:

      • Local kernels don't have a Jupyter server running
      • We use direct ZMQ connections, so shutdown() would fail with "Failed to parse URL"
      • We kill the kernel process directly with SIGTERM instead

      Returns Promise<void>

    • Start the local kernel by spawning ipykernel and connecting via ZMQ.

      Returns Promise<void>

      Error if the client has been disposed or if kernel type is jupyter-server