Class CompletionItem
java.lang.Object
org.graalvm.tools.lsp.server.types.JSONBase
org.graalvm.tools.lsp.server.types.CompletionItem
A completion item represents a text snippet that is proposed to complete text that is being
typed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletionItemCreate a completion item and seed it with a label.booleanAn optional array of additional [text edits](#TextEdit) that are applied when selecting this completion.An optional [command](#Command) that is executed *after* inserting this completion.An optional set of characters that when pressed while this completion is active will accept it first and then type that character.getData()An data entry field that is preserved on a completion item between a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] (#CompletionResolveRequest).Deprecated.Use `tags` instead.A human-readable string with additional information about this item, like type or symbol information.A human-readable string that represents a doc-comment.A string that should be used when filtering a set of completion items.A string that should be inserted into a document when selecting this completion.The format of the insert text.getKind()The kind of this completion item.getLabel()The label of this completion item.Select this item when showing.A string that should be used when comparing this item with other items.getTags()Tags for this completion item.An [edit](#TextEdit) which is applied to a document when selecting this completion.inthashCode()setAdditionalTextEdits(List<TextEdit> additionalTextEdits) setCommand(Command command) setCommitCharacters(List<String> commitCharacters) setDeprecated(Boolean deprecated) setDocumentation(Object documentation) setFilterText(String filterText) setInsertText(String insertText) setInsertTextFormat(InsertTextFormat insertTextFormat) setKind(CompletionItemKind kind) setPreselect(Boolean preselect) setSortText(String sortText) setTags(List<CompletionItemTag> tags) setTextEdit(TextEdit textEdit)
-
Method Details
-
getLabel
The label of this completion item. By default also the text that is inserted when selecting this completion. -
setLabel
-
getKind
The kind of this completion item. Based of the kind an icon is chosen by the editor. -
setKind
-
getTags
Tags for this completion item.- Since:
- 3.15.0
-
setTags
-
getDetail
A human-readable string with additional information about this item, like type or symbol information. -
setDetail
-
getDocumentation
A human-readable string that represents a doc-comment. -
setDocumentation
-
getDeprecated
Deprecated.Use `tags` instead.Indicates if this item is deprecated. -
setDeprecated
-
getPreselect
Select this item when showing. *Note* that only one completion item can be selected and that the tool / client decides which item that is. The rule is that the *first* item of those that match best is selected. -
setPreselect
-
getSortText
A string that should be used when comparing this item with other items. When `falsy` the [label](#CompletionItem.label) is used. -
setSortText
-
getFilterText
A string that should be used when filtering a set of completion items. When `falsy` the [label](#CompletionItem.label) is used. -
setFilterText
-
getInsertText
A string that should be inserted into a document when selecting this completion. When `falsy` the [label](#CompletionItem.label) is used. The `insertText` is subject to interpretation by the client side. Some tools might not take the string literally. For example VS Code when code complete is requested in this example `con` and a completion item with an `insertText` of `console` is provided it will only insert `sole`. Therefore it is recommended to use `textEdit` instead since it avoids additional client side interpretation. -
setInsertText
-
getInsertTextFormat
The format of the insert text. The format applies to both the `insertText` property and the `newText` property of a provided `textEdit`. If ommitted defaults to `InsertTextFormat.PlainText`. -
setInsertTextFormat
-
getTextEdit
An [edit](#TextEdit) which is applied to a document when selecting this completion. When an edit is provided the value of [insertText](#CompletionItem.insertText) is ignored. *Note:* The text edit's range must be a [single line] and it must contain the position at which completion has been requested. -
setTextEdit
-
getAdditionalTextEdits
An optional array of additional [text edits](#TextEdit) that are applied when selecting this completion. Edits must not overlap (including the same insert position) with the main [edit](#CompletionItem.textEdit) nor with themselves. Additional text edits should be used to change text unrelated to the current cursor position (for example adding an import statement at the top of the file if the completion item will insert an unqualified type). -
setAdditionalTextEdits
-
getCommitCharacters
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. -
setCommitCharacters
-
getCommand
An optional [command](#Command) that is executed *after* inserting this completion. *Note* that additional modifications to the current document should be described with the [additionalTextEdits](#CompletionItem.additionalTextEdits)-property. -
setCommand
-
getData
An data entry field that is preserved on a completion item between a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] (#CompletionResolveRequest). -
setData
-
equals
-
hashCode
public int hashCode() -
create
Create a completion item and seed it with a label.- Parameters:
label- The completion item's label
-