An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.

interface IInlineItem {
    filterText?: string;
    insertText: string;
    isIncomplete?: boolean;
    lastStreamed?: string;
    provider: IInlineCompletionProviderInfo;
    stream: ISignal<IInlineItem, StraemEvent>;
    streaming: boolean;
    token?: string;
}

Hierarchy (view full)

Properties

filterText?: string

A text that is used to decide if this inline completion should be shown. When falsy the insertText is used.

An inline completion is shown if the text to replace is a prefix of the filter text.

insertText: string

The text to replace the range with. Must be set. Is used both for the preview and the accept operation.

isIncomplete?: boolean

Whether generation of insertText is still ongoing. If your provider supports streaming, you can set this to true, which will result in the provider's stream() method being called with token which has to be set for incomplete completions.

lastStreamed?: string

Most recent streamed token if any.

The source provider information.

Signal emitted when the item gets updated by streaming.

streaming: boolean

Whether streaming is in progress.

token?: string