NotebookController

A notebook controller represents an entity that can execute notebook cells. This is often referred to as a kernel.

There can be multiple controllers and the editor will let users choose which controller to use for a certain notebook. The {@linkcode NotebookController.notebookType notebookType}-property defines for what kind of notebooks a controller is for and the {@linkcode NotebookController.updateNotebookAffinity updateNotebookAffinity}-function allows controllers to set a preference for specific notebook documents. When a controller has been selected its NotebookController.onDidChangeSelectedNotebooks-event fires.

When a cell is being run the editor will invoke the {@linkcode NotebookController.executeHandler executeHandler} and a controller is expected to create and finalize a notebook cell execution. However, controllers are also free to create executions by themselves.

Online Documentation

Properties

Link copied to clipboard
abstract var description: String?

The human-readable description which is rendered less prominent.

Link copied to clipboard
abstract var detail: String?

The human-readable detail which is rendered less prominent.

Link copied to clipboard

The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All, Run Selection etc. The execute handler is responsible for creating and managing execution-objects.

Link copied to clipboard
abstract val id: String

The identifier of this notebook controller.

Link copied to clipboard
abstract var interruptHandler: (notebook: NotebookDocument) -> PromiseLike<Void?>?

Optional interrupt handler.

Link copied to clipboard
abstract var label: String

The human-readable label of this notebook controller.

Link copied to clipboard
abstract val notebookType: String

The notebook type this controller is for.

Link copied to clipboard

An array of language identifiers that are supported by this controller. Any language identifier from {@linkcode languages.getLanguages getLanguages} is possible. When falsy all languages are supported.

Link copied to clipboard

Whether this controller supports execution order so that the editor can render placeholders for them.

Functions

Link copied to clipboard

Create a cell execution task.

Link copied to clipboard
abstract override fun dispose()

Dispose and free associated resources.

Link copied to clipboard

A controller can set affinities for specific notebook documents. This allows a controller to be presented more prominent for some notebooks.