Interface IInlineCompletionProvider<T>

The interface extensions should implement to provide inline completions.

interface IInlineCompletionProvider<
    T extends IInlineCompletionItem = IInlineCompletionItem,
> {
    icon?: ILabIcon;
    identifier: string;
    name: string;
    schema?: IProperty;
    configure(settings: { [property: string]: JSONValue }): void;
    fetch(
        request: CompletionHandler.IRequest,
        context: IInlineCompletionContext,
    ): Promise<IInlineCompletionList<T>>;
    stream(token: string): AsyncGenerator<{ response: T }, any, unknown>;
}

Type Parameters

Hierarchy (View Summary)

Implemented by

Properties

icon?: ILabIcon

The icon representing the provider in the user interface.

identifier: string

Unique identifier, cannot change on runtime.

The identifier is also added on data attribute of ghost text widget, allowing different providers to style the ghost text differently.

name: string

Name of the provider to be displayed in the user interface.

schema?: IProperty

Settings schema contributed by provider for user customization.

Methods

  • Optional method called when user changes settings.

    This is only called if schema for settings is present.

    Parameters

    Returns void