An implementation of a completer model.

Implements

Constructors

Properties

_completionItems: ICompletionItems = []
_current: null | ITextState = null
_cursor: null | ICursorSpan = null
_isDisposed: boolean = false
_orderedTypes: string[] = []
_original: null | ITextState = null
_processedToOriginalItem: null | WeakMap<ICompletionItem, ICompletionItem> = null

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: string = ''
_queryChanged: Signal<CompleterModel, IQueryChange> = ...
_resolvingItem: number = 0

A counter to cancel ongoing resolveItem call.

_stateChanged: Signal<CompleterModel, void> = ...
_subsetMatch: boolean = false
_typeMap: TypeMap = {}
processedItemsCache: null | ICompletionItems = null

Accessors

Methods

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

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

  • 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

    • hard: boolean = false

      Reset even if a subset match is in progress.

    Returns void

  • Lazy load missing data of an item.

    Parameters

    Returns undefined | Promise<null | 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.

    Remarks

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

  • 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