Class FileEditorAdapter

Hierarchy

Constructors

Properties

_activeEditorChanged: Signal<WidgetLSPAdapter<IDocumentWidget<FileEditor, DocumentRegistry.IModel>>, IEditorChangedData>

Signal emitted when the active editor have changed.

_adapterConnected: Signal<WidgetLSPAdapter<IDocumentWidget<FileEditor, DocumentRegistry.IModel>>, IDocumentConnectionData>

Signal emitted when the adapter is connected.

_disposed: Signal<WidgetLSPAdapter<IDocumentWidget<FileEditor, DocumentRegistry.IModel>>, void>

Signal emitted when the adapter is disposed.

_docRegistry: any

The document registry instance.

_editorAdded: Signal<WidgetLSPAdapter<IDocumentWidget<FileEditor, DocumentRegistry.IModel>>, IEditorChangedData>

Signal emitted when an editor is changed.

_editorRemoved: Signal<WidgetLSPAdapter<IDocumentWidget<FileEditor, DocumentRegistry.IModel>>, IEditorChangedData>

Signal emitted when an editor is removed.

_readyDelegate: any
_virtualEditor: any
editor: FileEditor

The wrapped FileEditor widget.

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 editors in the document, there is only one editor in the case of file editor.

    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 path(): string
  • Get current path 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. Since there is only one editor, this method always return 0

    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

    • index of the virtual editor
  • Get the wrapper of input editor.

    Parameters

    • ceEditor: IEditor

    Returns HTMLElement

  • 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

  • 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>

  • Returns void

  • Update the virtual document.

    Returns Promise<void>

Generated using TypeDoc