The data model backing a code completer widget.

interface IModel {
    current: null | ITextState;
    cursor: null | ICursorSpan;
    isDisposed: boolean;
    original: null | ITextState;
    query: string;
    queryChanged: ISignal<Completer.IModel, IQueryChange>;
    stateChanged: ISignal<Completer.IModel, void>;
    subsetMatch: boolean;
    completionItems(): ICompletionItems;
    createPatch(patch): undefined | IPatch;
    dispose(): void;
    handleCursorChange(change): void;
    handleTextChange(change): void;
    orderedTypes(): string[];
    reset(hard?): void;
    resolveItem(activeIndex): undefined | Promise<null | ICompletionItem>;
    setCompletionItems(items): void;
    typeMap(): TypeMap;


Implemented by


current: null | ITextState

The current text state details.

cursor: null | ICursorSpan

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

isDisposed: boolean

Test whether the object has been disposed.


This property is always safe to access.

original: null | ITextState

The original completer request details.

query: string

The query against which items are filtered.

A signal emitted when query string changes (at invocation, or as user types).

stateChanged: ISignal<Completer.IModel, void>

A signal emitted when state of the completer model changes.

subsetMatch: boolean

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


  • Dispose of the resources held by the object.


    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

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


    • Optional hard: boolean

      Reset even if a subset match is in progress.

    Returns void

  • Lazy load missing data of an item.


    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.


    Resolving item by index will be deprecated in the next major release.