Interface InlineCompletionsProvider<T>

interface InlineCompletionsProvider<T> {
    debounceDelayMs?: number;
    displayName?: string;
    excludesGroupIds?: string[];
    groupId?: string;
    onDidChangeInlineCompletions?: IEvent<void>;
    yieldsToGroupIds?: string[];
    disposeInlineCompletions(completions, reason): void;
    handleEndOfLifetime?(completions, item, reason, lifetimeSummary): void;
    handleItemDidShow?(completions, item, updatedInsertText): void;
    handlePartialAccept?(completions, item, acceptedCharacters, info): void;
    handleRejection?(completions, item): void;
    provideInlineCompletions(model, position, context, token): ProviderResult<T>;
    toString?(): string;
}

Type Parameters

Properties

debounceDelayMs?: number
displayName?: string
excludesGroupIds?: string[]
groupId?: string

Only used for yieldsToGroupIds. Multiple providers can have the same group id.

onDidChangeInlineCompletions?: IEvent<void>
yieldsToGroupIds?: string[]

Returns a list of preferred provider groupIds. The current provider is only requested for completions if no provider with a preferred group id returned a result.

Methods

  • Will be called when a completions list is no longer in use and can be garbage-collected.

    Parameters

    Returns void

  • Is called when an inline completion item is no longer being used. Provides a reason of why it is not used anymore.

    Parameters

    Returns void

  • Will be called when an item is shown.

    Parameters

    • completions: T
    • item: T["items"][number]
    • updatedInsertText: string

      Is useful to understand bracket completion.

    Returns void

  • Will be called when an item is partially accepted. TODO: also handle full acceptance here!

    Parameters

    • completions: T
    • item: T["items"][number]
    • acceptedCharacters: number

      Deprecated. Use info.acceptedCharacters instead.

    • info: PartialAcceptInfo

    Returns void

  • Parameters

    • completions: T
    • item: T["items"][number]

    Returns void

    Deprecated

    Use handleEndOfLifetime instead.

  • Returns string