interface InlineCompletion {
    action?: Command;
    additionalTextEdits?: ISingleEditOperation[];
    command?: Command;
    completeBracketPairs?: boolean;
    correlationId?: string;
    displayLocation?: InlineCompletionDisplayLocation;
    filterText?: string;
    insertText: string | {
        snippet: string;
    };
    isInlineEdit?: boolean;
    range?: IRange;
    showInlineEditMenu?: boolean;
    showRange?: IRange;
    shownCommand?: Command;
    warning?: InlineCompletionWarning;
}

Properties

action?: Command
additionalTextEdits?: ISingleEditOperation[]

An optional array of additional text edits that are applied when selecting this completion. Edits must not overlap with the main edit nor with themselves.

command?: Command
completeBracketPairs?: boolean

If set to true, unopened closing brackets are removed and unclosed opening brackets are closed. Defaults to false.

correlationId?: string

Used for telemetry.

filterText?: string

A text that is used to decide if this inline completion should be shown. An inline completion is shown if the text to replace is a subword of the filter text.

insertText: string | {
    snippet: string;
}

The text to insert. If the text contains a line break, the range must end at the end of a line. If existing text should be replaced, the existing text must be a prefix of the text to insert.

The text can also be a snippet. In that case, a preview with default parameters is shown. When accepting the suggestion, the full snippet is inserted.

Type declaration

  • snippet: string
isInlineEdit?: boolean
range?: IRange

The range to replace. Must begin and end on the same line.

showInlineEditMenu?: boolean
showRange?: IRange
shownCommand?: Command

Is called the first time an inline completion is shown. @deprecated. Use onDidShow of the provider instead.