Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CompleterModel

An implementation of a completer model.

Hierarchy

  • CompleterModel

Implements

Index

Constructors

constructor

Properties

Private _completionItems

_completionItems: any

Private _current

_current: any

Private _cursor

_cursor: any

Private _filter

_filter: any

Apply the query to the complete options list to return the matching subset.

Private _isDisposed

_isDisposed: any

Private _markup

_markup: any

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

Private _options

_options: any

Private _orderedTypes

_orderedTypes: any

Private _original

_original: any

Private _query

_query: any

Private _reset

_reset: any

Reset the state of the model.

Private _stateChanged

_stateChanged: any

Private _subsetMatch

_subsetMatch: any

Private _typeMap

_typeMap: any

Accessors

current

  • The current text change details.

    Returns ITextState | null

  • The current text change details.

    Parameters

    Returns any

cursor

  • The cursor details that the API has used to return matching options.

    Returns ICursorSpan | null

  • The cursor details that the API has used to return matching options.

    Parameters

    Returns any

isDisposed

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

    Returns boolean

original

  • The original completion request details.

    Returns ITextState | null

  • The original completion request details.

    Parameters

    Returns any

query

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

    Returns string

  • The query against which items are filtered.

    Parameters

    • newValue: string

    Returns any

stateChanged

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

    Returns ISignal<this, void>

subsetMatch

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

    Returns boolean

  • A flag that is true when the model value was modified by a subset match.

    Parameters

    • newValue: boolean

    Returns any

Methods

Optional completionItems

completionItems:

createPatch

  • createPatch(patch: string): IPatch | undefined
  • 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 | undefined

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

dispose

  • dispose(): void
  • Dispose of the resources held by the model.

    Returns void

handleCursorChange

handleTextChange

items

  • items(): IIterator<IItem>
  • The list of visible items in the completer menu.

    Notes

    This is a read-only property.

    Returns IIterator<IItem>

options

  • options(): IIterator<string>
  • The unfiltered list of all available options in a completer menu.

    Returns IIterator<string>

orderedTypes

  • orderedTypes(): string[]
  • 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 alphebetically. This will give reliable visual encoding for these known types, but allow kernels to provide new types.

    Returns string[]

reset

  • reset(hard?: boolean): void
  • 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

Optional setCompletionItems

setCompletionItems:

setOptions

  • setOptions(newValue: IterableOrArrayLike<string>, typeMap?: TypeMap): void
  • Set the available options in the completer menu.

    Parameters

    • newValue: IterableOrArrayLike<string>
    • Optional typeMap: TypeMap

    Returns void

typeMap

  • 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