public class CompletionItem
extends java.lang.Object
| Constructor and Description |
|---|
CompletionItem() |
CompletionItem(java.lang.String label) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<TextEdit> |
getAdditionalTextEdits()
An optional array of additional text edits that are applied when
selecting this completion.
|
Command |
getCommand()
An optional command that is executed after inserting this completion.
|
java.util.List<java.lang.String> |
getCommitCharacters()
An optional set of characters that when pressed while this completion is active will accept it first and
then type that character.
|
java.lang.Object |
getData()
A data entry field that is preserved on a completion item between a completion and a completion resolve request.
|
java.lang.Boolean |
getDeprecated()
Deprecated.
Use
tags instead if supported. |
java.lang.String |
getDetail()
A human-readable string with additional information about this item, like type or symbol information.
|
org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,MarkupContent> |
getDocumentation()
A human-readable string that represents a doc-comment.
|
java.lang.String |
getFilterText()
A string that should be used when filtering a set of completion items.
|
java.lang.String |
getInsertText()
A string that should be inserted a document when selecting this completion.
|
InsertTextFormat |
getInsertTextFormat()
The format of the insert text.
|
InsertTextMode |
getInsertTextMode()
How whitespace and indentation is handled during completion item
insertion.
|
CompletionItemKind |
getKind()
The kind of this completion item.
|
java.lang.String |
getLabel()
The label of this completion item.
|
CompletionItemLabelDetails |
getLabelDetails()
Additional details for the label
|
java.lang.Boolean |
getPreselect()
Select this item when showing.
|
java.lang.String |
getSortText()
A string that should be used when comparing this item with other items.
|
java.util.List<CompletionItemTag> |
getTags()
Tags for this completion item.
|
org.eclipse.lsp4j.jsonrpc.messages.Either<TextEdit,InsertReplaceEdit> |
getTextEdit()
An edit which is applied to a document when selecting this completion.
|
java.lang.String |
getTextEditText()
The edit text used if the completion item is part of a CompletionList and
CompletionList defines an item default for the text edit range.
|
int |
hashCode() |
void |
setAdditionalTextEdits(java.util.List<TextEdit> additionalTextEdits)
An optional array of additional text edits that are applied when
selecting this completion.
|
void |
setCommand(Command command)
An optional command that is executed after inserting this completion.
|
void |
setCommitCharacters(java.util.List<java.lang.String> commitCharacters)
An optional set of characters that when pressed while this completion is active will accept it first and
then type that character.
|
void |
setData(java.lang.Object data)
A data entry field that is preserved on a completion item between a completion and a completion resolve request.
|
void |
setDeprecated(java.lang.Boolean deprecated)
Deprecated.
Use
tags instead if supported. |
void |
setDetail(java.lang.String detail)
A human-readable string with additional information about this item, like type or symbol information.
|
void |
setDocumentation(org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,MarkupContent> documentation)
A human-readable string that represents a doc-comment.
|
void |
setDocumentation(MarkupContent documentation) |
void |
setDocumentation(java.lang.String documentation) |
void |
setFilterText(java.lang.String filterText)
A string that should be used when filtering a set of completion items.
|
void |
setInsertText(java.lang.String insertText)
A string that should be inserted a document when selecting this completion.
|
void |
setInsertTextFormat(InsertTextFormat insertTextFormat)
The format of the insert text.
|
void |
setInsertTextMode(InsertTextMode insertTextMode)
How whitespace and indentation is handled during completion item
insertion.
|
void |
setKind(CompletionItemKind kind)
The kind of this completion item.
|
void |
setLabel(java.lang.String label)
The label of this completion item.
|
void |
setLabelDetails(CompletionItemLabelDetails labelDetails)
Additional details for the label
|
void |
setPreselect(java.lang.Boolean preselect)
Select this item when showing.
|
void |
setSortText(java.lang.String sortText)
A string that should be used when comparing this item with other items.
|
void |
setTags(java.util.List<CompletionItemTag> tags)
Tags for this completion item.
|
void |
setTextEdit(org.eclipse.lsp4j.jsonrpc.messages.Either<TextEdit,InsertReplaceEdit> textEdit)
An edit which is applied to a document when selecting this completion.
|
void |
setTextEditText(java.lang.String textEditText)
The edit text used if the completion item is part of a CompletionList and
CompletionList defines an item default for the text edit range.
|
java.lang.String |
toString() |
public CompletionItem()
public CompletionItem(java.lang.String label)
@Pure public java.lang.String getLabel()
If label details are provided, the label itself should be an unqualified name of the completion item.
public void setLabel(java.lang.String label)
If label details are provided, the label itself should be an unqualified name of the completion item.
@Pure public CompletionItemLabelDetails getLabelDetails()
Since 3.17.0
public void setLabelDetails(CompletionItemLabelDetails labelDetails)
Since 3.17.0
@Pure public CompletionItemKind getKind()
public void setKind(CompletionItemKind kind)
@Pure public java.util.List<CompletionItemTag> getTags()
Since 3.15.0
public void setTags(java.util.List<CompletionItemTag> tags)
Since 3.15.0
@Pure public java.lang.String getDetail()
public void setDetail(java.lang.String detail)
@Pure public org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,MarkupContent> getDocumentation()
public void setDocumentation(org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,MarkupContent> documentation)
public void setDocumentation(java.lang.String documentation)
public void setDocumentation(MarkupContent documentation)
@Pure @Deprecated public java.lang.Boolean getDeprecated()
tags instead if supported.Since 3.8.0
@Deprecated public void setDeprecated(java.lang.Boolean deprecated)
tags instead if supported.Since 3.8.0
@Pure public java.lang.Boolean getPreselect()
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.
Since 3.9.0
public void setPreselect(java.lang.Boolean preselect)
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.
Since 3.9.0
@Pure public java.lang.String getSortText()
label is used as the sort text for this item.public void setSortText(java.lang.String sortText)
label is used as the sort text for this item.@Pure public java.lang.String getFilterText()
label is used as the filter text for this item.public void setFilterText(java.lang.String filterText)
label is used as the filter text for this item.@Pure public java.lang.String getInsertText()
label is used as the insert text for this item.public void setInsertText(java.lang.String insertText)
label is used as the insert text for this item.@Pure public InsertTextFormat getInsertTextFormat()
insertText property
and the newText property of a provided textEdit. If omitted, defaults to
InsertTextFormat.PlainText.
Please note that this doesn't apply to additionalTextEdits.
public void setInsertTextFormat(InsertTextFormat insertTextFormat)
insertText property
and the newText property of a provided textEdit. If omitted, defaults to
InsertTextFormat.PlainText.
Please note that this doesn't apply to additionalTextEdits.
@Pure public InsertTextMode getInsertTextMode()
CompletionCapabilities.insertTextMode client capability.
Since 3.16.0
public void setInsertTextMode(InsertTextMode insertTextMode)
CompletionCapabilities.insertTextMode client capability.
Since 3.16.0
@Pure public org.eclipse.lsp4j.jsonrpc.messages.Either<TextEdit,InsertReplaceEdit> getTextEdit()
insertText is ignored.
Note: The range of the edit must be a single line range and it must contain the position at which completion has been requested.
Most editors support two different operations when accepting a completion
item. One is to insert a completion text and the other is to replace an
existing text with a completion text. Since this can usually not be
predetermined by a server it can report both ranges. Clients need to
signal support for InsertReplaceEdits via the
CompletionItemCapabilities.insertReplaceSupport client capability
property.
Note 1: The text edit's range as well as both ranges from an insert replace edit must be a [single line] and they must contain the position at which completion has been requested.
Note 2: If an InsertReplaceEdit is returned the edit's insert range
must be a prefix of the edit's replace range, that means it must be
contained and starting at the same position.
Since 3.16.0 additional type InsertReplaceEdit
public void setTextEdit(org.eclipse.lsp4j.jsonrpc.messages.Either<TextEdit,InsertReplaceEdit> textEdit)
insertText is ignored.
Note: The range of the edit must be a single line range and it must contain the position at which completion has been requested.
Most editors support two different operations when accepting a completion
item. One is to insert a completion text and the other is to replace an
existing text with a completion text. Since this can usually not be
predetermined by a server it can report both ranges. Clients need to
signal support for InsertReplaceEdits via the
CompletionItemCapabilities.insertReplaceSupport client capability
property.
Note 1: The text edit's range as well as both ranges from an insert replace edit must be a [single line] and they must contain the position at which completion has been requested.
Note 2: If an InsertReplaceEdit is returned the edit's insert range
must be a prefix of the edit's replace range, that means it must be
contained and starting at the same position.
Since 3.16.0 additional type InsertReplaceEdit
@Pure public java.lang.String getTextEditText()
Clients will only honor this property if they opt into completion list
item defaults using the capability CompletionListCapabilities.itemDefaults.
If not provided and a list's default range is provided the label property is used as a text.
Since 3.17.0
public void setTextEditText(java.lang.String textEditText)
Clients will only honor this property if they opt into completion list
item defaults using the capability CompletionListCapabilities.itemDefaults.
If not provided and a list's default range is provided the label property is used as a text.
Since 3.17.0
@Pure public java.util.List<TextEdit> getAdditionalTextEdits()
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).
public void setAdditionalTextEdits(java.util.List<TextEdit> additionalTextEdits)
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).
@Pure public java.util.List<java.lang.String> getCommitCharacters()
length=1 and that superfluous
characters will be ignored.
Since 3.2.0
public void setCommitCharacters(java.util.List<java.lang.String> commitCharacters)
length=1 and that superfluous
characters will be ignored.
Since 3.2.0
@Pure public Command getCommand()
additionalTextEdits property.public void setCommand(Command command)
additionalTextEdits property.@Pure public java.lang.Object getData()
public void setData(java.lang.Object data)
@Pure public java.lang.String toString()
toString in class java.lang.Object@Pure public boolean equals(java.lang.Object obj)
equals in class java.lang.Object@Pure public int hashCode()
hashCode in class java.lang.Object