Options
All
  • Public
  • Public/Protected
  • All
Menu

A completion handler for editors. A namespace for cell completion handler statics.

Hierarchy

  • CompletionHandler

Implements

  • IDisposable

Index

Type aliases

Static ICompletionItems

ICompletionItems: ReadonlyArray<ICompletionItem>

Type alias for ICompletionItem list. Implementers of this interface should be responsible for deduping and sorting the items in the list.

Static ICompletionItemsConnector

Constructors

constructor

Properties

Private _connector

Private _editor

_editor: IEditor | null = null

Private _enabled

_enabled: boolean = false

Private _isDisposed

_isDisposed: boolean = false

Private _pending

_pending: number = 0

completer

completer: Completer

The completer widget managed by the handler.

Static ICompletionItemsResponseType

ICompletionItemsResponseType: "ICompletionItemsReply" = 'ICompletionItemsReply' as const

Accessors

connector

editor

  • get editor(): IEditor | null
  • set editor(newValue: IEditor | null): void

isDisposed

  • get isDisposed(): boolean

Methods

Private _isICompletionItemsConnector

Private _makeRequest

  • _makeRequest(position: IPosition): Promise<void>

Private _onFailure

  • _onFailure(): void

Private _onFetchItemsReply

Private _onReply

Private _updateModel

Private _validate

  • _validate(pending: number, request: IRequest): void

dispose

  • dispose(): void

Protected getState

invoke

  • invoke(): void

Protected onCompletionSelected

  • onCompletionSelected(completer: Completer, val: string): void

Protected onInvokeRequest

  • onInvokeRequest(msg: Message): void

Protected onSelectionsChanged

  • onSelectionsChanged(): void
  • Handle selection changed signal from an editor.

    Notes

    If a sub-class reimplements this method, then that class must either call its super method or it must take responsibility for adding and removing the completer completable class to the editor host node.

    Despite the fact that the editor widget adds a class whenever there is a primary selection, this method checks independently for two reasons:

    1. The editor widget connects to the same signal to add that class, so there is no guarantee that the class will be added before this method is invoked so simply checking for the CSS class's existence is not an option. Secondarily, checking the editor state should be faster than querying the DOM in either case.
    2. Because this method adds a class that indicates whether completer functionality ought to be enabled, relying on the behavior of the jp-mod-has-primary-selection to filter out any editors that have a selection means the semantic meaning of jp-mod-completer-enabled is obscured because there may be cases where the enabled class is added even though the completer is not available.

    Returns void

Protected onTextChanged

  • onTextChanged(): void

Protected onVisibilityChanged

  • onVisibilityChanged(completer: Completer): void

processMessage

  • processMessage(msg: Message): void

Generated using TypeDoc