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: string): undefined | IPatch;
    dispose(): void;
    handleCursorChange(change: ITextState): void;
    handleTextChange(change: ITextState): void;
    orderedTypes(): string[];
    reset(hard?: boolean): void;
    resolveItem(
        activeIndex: number | ICompletionItem,
    ): undefined | Promise<null | ICompletionItem>;
    setCompletionItems(items: ICompletionItems): void;
    typeMap(): TypeMap;
}

Hierarchy

Implemented by

Properties

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.

Methods

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

    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.

    Parameters

    • Optionalhard: boolean

      Reset even if a subset match is in progress.

    Returns void