Class CompleterModel

An implementation of a completer model.

Hierarchy

  • CompleterModel

Implements

Constructors

Properties

_completionItems: any
_current: any
_cursor: any
_escapeItemLabel: any

Escape item label, storing the original label and adding insertText if needed. If escaping changes label creates a new item unless inplace is true.

_isDisposed: any
_markup: any

Check if CompletionItem matches against query. Highlight matching prefix by adding tags.

_orderedTypes: any
_original: any
_processedToOriginalItem: any

The weak map between a processed completion item with the original item. It's used to keep track of original completion item in case of displaying the completer with query.

_query: any
_queryChanged: any
_reset: any

Reset the state of the model.

_resolveItemByValue: any

Lazy load missing data of a completion item.

Param

the item to be resolved

Returns

See resolveItem method

_resolvingItem: any

A counter to cancel ongoing resolveItem call.

_stateChanged: any
_subsetMatch: any
_typeMap: any
processedItemsCache: ICompletionItems

Accessors

  • get current(): ITextState
  • The current text change details.

    Returns ITextState

  • set current(newValue): void
  • The current text state details.

    Parameters

    Returns void

  • get cursor(): ICursorSpan
  • The cursor details that the API has used to return matching options.

    Returns ICursorSpan

  • set cursor(newValue): void
  • The cursor details that the API has used to return matching options.

    Parameters

    Returns void

  • get isDisposed(): boolean
  • Get whether the model is disposed.

    Returns boolean

  • get original(): ITextState
  • The original completion request details.

    Returns ITextState

  • set original(newValue): void
  • The original completer request details.

    Parameters

    Returns void

  • get query(): string
  • The query against which items are filtered.

    Returns string

  • set query(newValue): void
  • The query against which items are filtered.

    Parameters

    • newValue: string

    Returns void

  • get stateChanged(): ISignal<this, void>
  • A signal emitted when state of the completer menu changes.

    Returns ISignal<this, void>

  • get subsetMatch(): boolean
  • A flag that is true when the model value was modified by a subset match.

    Returns boolean

  • set subsetMatch(newValue): void
  • A flag that is true when the model value was modified by a subset match.

    Parameters

    • newValue: boolean

    Returns void

Methods

  • The list of visible items in the completer menu.

    Notes

    This is a read-only property. When overriding it is recommended to cache results in processedItemsCache property which will be automatically nullified when needed.

    Returns ICompletionItems

  • Create a resolved patch between the original state and a patch string.

    Parameters

    • patch: string

      The patch string to apply to the original value.

    Returns IPatch

    A patched text change or undefined if original value did not exist.

  • Dispose of the resources held by the model.

    Returns void

  • Handle a cursor change.

    Parameters

    Returns void

  • Handle a text change.

    Parameters

    Returns void

  • An ordered list of all the known types in the typeMap.

    Notes

    To visually encode the types of the completer matches, we assemble an ordered list. This list begins with:

    ['function', 'instance', 'class', 'module', 'keyword']
    

    and then has any remaining types listed alphabetically. This will give reliable visual encoding for these known types, but allow kernels to provide new types.

    Returns string[]

  • Reset the state of the model and emit a state change signal.

    Parameters

    • Optional hard: boolean

      Reset even if a subset match is in progress.

    Returns void

  • Lazy load missing data of an item.

    Remarks

    Resolving item by index will be deprecated in the JupyterLab 5.0 and removed in JupyterLab 6.0.

    Parameters

    Returns Promise<ICompletionItem>

    Return undefined if the completion item with activeIndex index can not be found. Return a promise of null if another resolveItem is called. Otherwise return the promise of resolved completion item.

  • Set the list of visible items in the completer menu, and append any new types to KNOWN_TYPES.

    Parameters

    Returns void

  • The map from identifiers (a.b) to types (function, module, class, instance, etc.).

    Notes

    A type map is currently only provided by the latest IPython kernel using the completer reply metadata field _jupyter_types_experimental. The values are completely up to the kernel.

    Returns TypeMap

Generated using TypeDoc