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

  • The current text change details.

    Parameters

    Returns void

cursor

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

    Returns ICursorSpan

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

    Parameters

    Returns void

isDisposed

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

    Returns boolean

original

  • The original completion request details.

    Returns ITextState

  • The original completion request details.

    Parameters

    Returns void

query

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

    Returns string

  • The query against which items are filtered.

    Parameters

    • newValue: string

    Returns void

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): void
  • 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 void

Methods

Optional completionItems

createPatch

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

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

    deprecated

    use completionItems instead

    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 alphabetically. 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

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

    Parameters

    Returns void

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