Class NotebookAdapter

Hierarchy

Constructors

  • Parameters

    Returns NotebookAdapter

Properties

_activeCellChanged: any

Handle the cell changed event

Param

The notebook that emitted event

Param

Changed cell.

_activeEditorChanged: Signal<WidgetLSPAdapter<NotebookPanel>, IEditorChangedData>

Signal emitted when the active editor have changed.

_adapterConnected: Signal<WidgetLSPAdapter<NotebookPanel>, IDocumentConnectionData>

Signal emitted when the adapter is connected.

_cellToEditor: any

Mapping of cell to editor accessor to ensure accessor uniqueness.

_connectModelSignals: any

Connect the cell changed event to its handler

Param

The notebook that emitted event.

_disposed: Signal<WidgetLSPAdapter<NotebookPanel>, void>

Signal emitted when the adapter is disposed.

_editorAdded: Signal<WidgetLSPAdapter<NotebookPanel>, IEditorChangedData>

Signal emitted when an editor is changed.

_editorRemoved: Signal<WidgetLSPAdapter<NotebookPanel>, IEditorChangedData>

Signal emitted when an editor is removed.

_editorToCell: any

A map between the editor accessor and the containing cell

_getCellAt: any

Get the cell at the cursor position of the virtual document.

Param

Position in the virtual document.

_getCellEditor: any

Get the cell editor and add new ones to the mappings.

Param

Cell widget

Returns

Cell editor accessor

_languageInfo: any

Metadata of the notebook

_readyDelegate: any
_type: any
_updateLanguageInfo: any

Update the stored language info with the one from the notebook.

editor: Notebook

The wrapped Notebook widget.

editorWidget: NotebookPanel
options: IAdapterOptions

Accessors

  • get activeEditor(): IEditor
  • Get the activated CM editor.

    Returns IEditor

  • get activeEditorChanged(): ISignal<WidgetLSPAdapter<T>, IEditorChangedData>
  • Signal emitted when the active editor have changed.

    Returns ISignal<WidgetLSPAdapter<T>, IEditorChangedData>

  • get adapterConnected(): ISignal<WidgetLSPAdapter<T>, IDocumentConnectionData>
  • Signal emitted when the adapter is connected.

    Returns ISignal<WidgetLSPAdapter<T>, IDocumentConnectionData>

  • get connectionManager(): ILSPDocumentConnectionManager
  • The LSP document and connection manager instance.

    Returns ILSPDocumentConnectionManager

  • get disposed(): ISignal<WidgetLSPAdapter<T>, void>
  • Signal emitted when the adapter is disposed.

    Returns ISignal<WidgetLSPAdapter<T>, void>

  • get documentPath(): string
  • Get current path of the document.

    Returns string

  • get editorAdded(): ISignal<WidgetLSPAdapter<T>, IEditorChangedData>
  • Signal emitted when the an editor is changed.

    Returns ISignal<WidgetLSPAdapter<T>, IEditorChangedData>

  • get editorRemoved(): ISignal<WidgetLSPAdapter<T>, IEditorChangedData>
  • Signal emitted when the an editor is removed.

    Returns ISignal<WidgetLSPAdapter<T>, IEditorChangedData>

  • get editors(): ICodeBlockOptions[]
  • Get the list of CM editor with its type in the document,

    Returns ICodeBlockOptions[]

  • get hasMultipleEditors(): boolean
  • Check if the document contains multiple editors

    Returns boolean

  • get isConnected(): boolean
  • The virtual document is connected or not

    Returns boolean

  • get isDisposed(): boolean
  • Check if the adapter is disposed

    Returns boolean

  • get language(): string
  • Get the language identifier of the document

    Returns string

  • get languageFileExtension(): string
  • Get the file extension of the document.

    Returns string

  • get mimeType(): string
  • Get the mime type of the document.

    Returns string

  • get ready(): Promise<void>
  • Promise that resolves once the adapter is initialized

    Returns Promise<void>

  • get updateFinished(): Promise<void>
  • Promise that resolves once the document is updated

    Returns Promise<void>

  • get virtualDocument(): VirtualDocument
  • Internal virtual document of the adapter.

    Returns VirtualDocument

  • get widgetId(): string
  • Get the ID of the internal widget.

    Returns string

  • get wrapperElement(): HTMLElement
  • Get the inner HTMLElement of the document widget.

    Returns HTMLElement

Methods

  • Opens a connection for the document. The connection may or may not be initialized, yet, and depending on when this is called, the client may not be fully connected.

    Parameters

    • virtualDocument: VirtualDocument

      a VirtualDocument

    • Optional sendOpen: boolean

      whether to open the document immediately

    Returns Promise<void>

  • Generate the virtual document associated with the document.

    Returns VirtualDocument

  • Disconnect virtual document from the language server.

    Returns void

  • Dispose the widget.

    Returns void

  • Callback called on the document changed event.

    Parameters

    • virtualDocument: VirtualDocument
    • document: VirtualDocument
    • Optional isInit: boolean

    Returns void

  • Get the index of input editor

    Parameters

    • ceEditor: IEditor

      instance of the code editor

    Returns number

  • Get the index of editor from the cursor position in the virtual document.

    Deprecated

    This is error-prone and will be removed in JupyterLab 5.0, use getEditorIndex() with virtualDocument.getEditorAtVirtualLine(position) instead.

    Parameters

    • position: IVirtualPosition

      the position of cursor in the virtual document.

    Returns number

  • Get the wrapper of input editor.

    Parameters

    • ceEditor: IEditor

      instance of the code editor

    Returns HTMLElement

  • Update the virtual document on cell changing event.

    Parameters

    Returns Promise<void>

  • Initialization function called once the editor and the LSP connection manager is ready. This function will create the virtual document and connect various signals.

    Returns Promise<void>

  • Create the virtual document using current path and language.

    Returns void

  • Method to check if the notebook context is ready.

    Returns boolean

  • Connect the virtual document with the language server.

    Parameters

    • data: IDocumentConnectionData

    Returns Promise<void>

  • Callback on connection closed event.

    Parameters

    • _: ILSPDocumentConnectionManager
    • __namedParameters: IDocumentConnectionData

    Returns void

  • Handler for opening a document contained in a parent document. The assumption is that the editor already exists for this, and as such the document should be queued for immediate opening.

    Parameters

    • _: VirtualDocument
    • context: IForeignContext

      information about the foreign VirtualDocument

    Returns Promise<void>

  • Callback on kernel changed event, it will disconnect the document with the language server and then reconnect.

    Parameters

    Returns Promise<void>

  • Returns void

  • Update the virtual document.

    Returns Promise<void>

Generated using TypeDoc