Interface CompletionItem
Expand description
interface CompletionItem {
action?: Command;
additionalTextEdits?: ISingleEditOperation[];
command?: Command;
commitCharacters?: string[];
detail?: string;
documentation?: string | IMarkdownString;
filterText?: string;
insertText: string;
insertTextRules?: CompletionItemInsertTextRule;
kind: CompletionItemKind;
label: string | CompletionItemLabel;
preselect?: boolean;
range: IRange | CompletionItemRanges;
sortText?: string;
tags?: readonly Deprecated[];
}Properties§
action?: CommandA command that should be run upon acceptance of this item.
additional Text Edits?: 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?: CommandA command that should be run upon acceptance of this item.
commit Characters?: string[]An optional set of characters that when pressed while this completion is active will accept it first and
then type that character. Note that all commit characters should have length=1 and that superfluous
characters will be ignored.
detail?: stringA human-readable string with additional information about this item, like type or symbol information.
documentation?: string | IMarkdownStringA human-readable string that represents a doc-comment.
filter Text?: stringA string that should be used when filtering a set of
completion items. When falsy the label
is used.
insert Text: stringA string or snippet that should be inserted in a document when selecting this completion.
insert Text Rules?: CompletionItemInsertTextRuleAdditional rules (as bitmask) that should be applied when inserting this completion.
kind: CompletionItemKindThe kind of this completion item. Based on the kind an icon is chosen by the editor.
label: string | CompletionItemLabelThe label of this completion item. By default this is also the text that is inserted when selecting this completion.
preselect?: booleanSelect this item when showing. Note that only one completion item can be selected and that the editor decides which item that is. The rule is that the first item of those that match best is selected.
range: IRange | CompletionItemRangesA range of text that should be replaced by this completion item.
Note: The range must be a single line and it must Range.contains contain the position at which completion has been requested.
sort Text?: stringA string that should be used when comparing this item
with other items. When falsy the label
is used.
A modifier to the kind which affect how the item
is rendered, e.g. Deprecated is rendered with a strikeout
A completion item represents a text snippet that is proposed to complete text that is being typed.