A completion item represents a text snippet that is proposed to complete text that is being typed.
It is sufficient to create a completion item from just a {@link CompletionItem.label label}. In that case the completion item will replace the {@link TextDocument.getWordRangeAtPosition word} until the cursor with the given label or {@link CompletionItem.insertText insertText}. Otherwise the given {@link CompletionItem.textEdit edit} is used.
When selecting a completion item in the editor its defined or synthesized text edit will be applied to all cursors/selections whereas {@link CompletionItem.additionalTextEdits additionalTextEdits} will be applied as provided.
A completion item represents a text snippet that is proposed to complete text that is being typed. It is sufficient to create a completion item from just a {@link CompletionItem.label label}. In that case the completion item will replace the {@link TextDocument.getWordRangeAtPosition word} until the cursor with the given label or {@link CompletionItem.insertText insertText}. Otherwise the given {@link CompletionItem.textEdit edit} is used. When selecting a completion item in the editor its defined or synthesized text edit will be applied to *all* cursors/selections whereas {@link CompletionItem.additionalTextEdits additionalTextEdits} will be applied as provided.
(additional-text-edits completion-item)
An optional array of additional {@link TextEdit text edits} that are applied when selecting this completion. Edits must not overlap with the main {@link CompletionItem.textEdit edit} nor with themselves.
Returns: TextEdit[] | undefined
An optional array of additional {@link TextEdit text edits} that are applied when selecting this completion. Edits must not overlap with the main {@link CompletionItem.textEdit edit} nor with themselves. **Returns:** `TextEdit[] | undefined`
(command completion-item)
An optional {@link Command } that is executed after inserting this completion. Note that additional modifications to the current document should be described with the {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.
Returns: Command | undefined
An optional {@link Command } that is executed *after* inserting this completion. *Note* that additional modifications to the current document should be described with the {@link CompletionItem.additionalTextEdits additionalTextEdits}-property. **Returns:** `Command | undefined`
(commit-characters completion-item)
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.
Returns: string[] | undefined
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. **Returns:** `string[] | undefined`
(detail completion-item)
A human-readable string with additional information about this item, like type or symbol information.
Returns: string | undefined
A human-readable string with additional information about this item, like type or symbol information. **Returns:** `string | undefined`
(documentation completion-item)
A human-readable string that represents a doc-comment.
Returns: string | MarkdownString | undefined
A human-readable string that represents a doc-comment. **Returns:** `string | MarkdownString | undefined`
(filter-text completion-item)
A string that should be used when filtering a set of
completion items. When falsy
the {@link CompletionItem.label label}
is used.
Note that the filter text is matched against the leading word (prefix) which is defined by the {@linkcode CompletionItem.range range}-property.
Returns: string | undefined
A string that should be used when filtering a set of completion items. When `falsy` the {@link CompletionItem.label label} is used. Note that the filter text is matched against the leading word (prefix) which is defined by the {@linkcode CompletionItem.range range}-property. **Returns:** `string | undefined`
(insert-text completion-item)
A string or snippet that should be inserted in a document when selecting
this completion. When falsy
the {@link CompletionItem.label label}
is used.
Returns: string | SnippetString | undefined
A string or snippet that should be inserted in a document when selecting this completion. When `falsy` the {@link CompletionItem.label label} is used. **Returns:** `string | SnippetString | undefined`
(keep-whitespace? completion-item)
Keep whitespace of the {@link CompletionItem.insertText insertText} as is. By default, the editor adjusts leading
whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting
this to true
will prevent that.
Returns: boolean | undefined
Keep whitespace of the {@link CompletionItem.insertText insertText} as is. By default, the editor adjusts leading whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting this to `true` will prevent that. **Returns:** `boolean | undefined`
(kind completion-item)
The kind of this completion item. Based on the kind an icon is chosen by the editor.
Returns: CompletionItemKind | undefined
The kind of this completion item. Based on the kind an icon is chosen by the editor. **Returns:** `CompletionItemKind | undefined`
(label completion-item)
The label of this completion item. By default this is also the text that is inserted when selecting this completion.
Returns: string | CompletionItemLabel
The label of this completion item. By default this is also the text that is inserted when selecting this completion. **Returns:** `string | CompletionItemLabel`
(preselect? completion-item)
Select 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.
Returns: boolean | undefined
Select 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. **Returns:** `boolean | undefined`
(range completion-item)
A range or a insert and replace range selecting the text that should be replaced by this completion item.
When omitted, the range of the {@link TextDocument.getWordRangeAtPosition current word} is used as replace-range and as insert-range the start of the {@link TextDocument.getWordRangeAtPosition current word} to the current position is used.
Note 1: A range must be a {@link Range.isSingleLine single line} and it must {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. Note 2: A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
Returns: Range | { inserting: Range; replacing: Range; } | undefined
A range or a insert and replace range selecting the text that should be replaced by this completion item. When omitted, the range of the {@link TextDocument.getWordRangeAtPosition current word} is used as replace-range and as insert-range the start of the {@link TextDocument.getWordRangeAtPosition current word} to the current position is used. *Note 1:* A range must be a {@link Range.isSingleLine single line} and it must {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position. **Returns:** `Range | { inserting: Range; replacing: Range; } | undefined`
(set-additional-text-edits! completion-item value)
An optional array of additional {@link TextEdit text edits} that are applied when selecting this completion. Edits must not overlap with the main {@link CompletionItem.textEdit edit} nor with themselves.
An optional array of additional {@link TextEdit text edits} that are applied when selecting this completion. Edits must not overlap with the main {@link CompletionItem.textEdit edit} nor with themselves.
(set-command! completion-item value)
An optional {@link Command } that is executed after inserting this completion. Note that additional modifications to the current document should be described with the {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.
An optional {@link Command } that is executed *after* inserting this completion. *Note* that additional modifications to the current document should be described with the {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.
(set-commit-characters! completion-item value)
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.
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.
(set-detail! completion-item value)
A human-readable string with additional information about this item, like type or symbol information.
A human-readable string with additional information about this item, like type or symbol information.
(set-documentation! completion-item value)
A human-readable string that represents a doc-comment.
A human-readable string that represents a doc-comment.
(set-filter-text! completion-item value)
A string that should be used when filtering a set of
completion items. When falsy
the {@link CompletionItem.label label}
is used.
Note that the filter text is matched against the leading word (prefix) which is defined by the {@linkcode CompletionItem.range range}-property.
A string that should be used when filtering a set of completion items. When `falsy` the {@link CompletionItem.label label} is used. Note that the filter text is matched against the leading word (prefix) which is defined by the {@linkcode CompletionItem.range range}-property.
(set-insert-text! completion-item value)
A string or snippet that should be inserted in a document when selecting
this completion. When falsy
the {@link CompletionItem.label label}
is used.
A string or snippet that should be inserted in a document when selecting this completion. When `falsy` the {@link CompletionItem.label label} is used.
(set-keep-whitespace! completion-item value)
Keep whitespace of the {@link CompletionItem.insertText insertText} as is. By default, the editor adjusts leading
whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting
this to true
will prevent that.
Keep whitespace of the {@link CompletionItem.insertText insertText} as is. By default, the editor adjusts leading whitespace of new lines so that they match the indentation of the line for which the item is accepted - setting this to `true` will prevent that.
(set-kind! completion-item value)
The kind of this completion item. Based on the kind an icon is chosen by the editor.
The kind of this completion item. Based on the kind an icon is chosen by the editor.
(set-label! completion-item value)
The label of this completion item. By default this is also the text that is inserted when selecting this completion.
The label of this completion item. By default this is also the text that is inserted when selecting this completion.
(set-preselect! completion-item value)
Select 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.
Select 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.
(set-range! completion-item value)
A range or a insert and replace range selecting the text that should be replaced by this completion item.
When omitted, the range of the {@link TextDocument.getWordRangeAtPosition current word} is used as replace-range and as insert-range the start of the {@link TextDocument.getWordRangeAtPosition current word} to the current position is used.
Note 1: A range must be a {@link Range.isSingleLine single line} and it must {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. Note 2: A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
A range or a insert and replace range selecting the text that should be replaced by this completion item. When omitted, the range of the {@link TextDocument.getWordRangeAtPosition current word} is used as replace-range and as insert-range the start of the {@link TextDocument.getWordRangeAtPosition current word} to the current position is used. *Note 1:* A range must be a {@link Range.isSingleLine single line} and it must {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
(set-sort-text! completion-item value)
A string that should be used when comparing this item
with other items. When falsy
the {@link CompletionItem.label label}
is used.
Note that sortText
is only used for the initial ordering of completion
items. When having a leading word (prefix) ordering is based on how
well completions match that prefix and the initial ordering is only used
when completions match equally well. The prefix is defined by the
{@linkcode CompletionItem.range range}-property and can therefore be different
for each completion.
A string that should be used when comparing this item with other items. When `falsy` the {@link CompletionItem.label label} is used. Note that `sortText` is only used for the initial ordering of completion items. When having a leading word (prefix) ordering is based on how well completions match that prefix and the initial ordering is only used when completions match equally well. The prefix is defined by the {@linkcode CompletionItem.range range}-property and can therefore be different for each completion.
(set-tags! completion-item value)
Tags for this completion item.
Tags for this completion item.
(sort-text completion-item)
A string that should be used when comparing this item
with other items. When falsy
the {@link CompletionItem.label label}
is used.
Note that sortText
is only used for the initial ordering of completion
items. When having a leading word (prefix) ordering is based on how
well completions match that prefix and the initial ordering is only used
when completions match equally well. The prefix is defined by the
{@linkcode CompletionItem.range range}-property and can therefore be different
for each completion.
Returns: string | undefined
A string that should be used when comparing this item with other items. When `falsy` the {@link CompletionItem.label label} is used. Note that `sortText` is only used for the initial ordering of completion items. When having a leading word (prefix) ordering is based on how well completions match that prefix and the initial ordering is only used when completions match equally well. The prefix is defined by the {@linkcode CompletionItem.range range}-property and can therefore be different for each completion. **Returns:** `string | undefined`
(tags completion-item)
Tags for this completion item.
Returns: readonly CompletionItemTag[] | undefined
Tags for this completion item. **Returns:** `readonly CompletionItemTag[] | undefined`
(text-edit completion-item)
Returns: TextEdit | undefined
**Returns:** `TextEdit | undefined`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close