public static final class CompletionCollector.Builder extends Object
Completion
instances. Its usage can be illustrated by:
// Create a builder for creating 'Completion' instance providing its 'label'Completion
c =CompletionCollector
.newBuilder("label") // set completion detail .detail("detail") // set completion documentation with deffered computation .documentation(() -> { return "documentation"; }) // create a new 'Completion' instance .build();
Modifier and Type | Method and Description |
---|---|
CompletionCollector.Builder |
addCommitCharacter(char commitCharacter)
Adds character that when pressed while this completion is active will
accept it first and then type that character.
|
CompletionCollector.Builder |
additionalTextEdits(List<TextEdit> additionalTextEdits)
A list of additional text edits that are applied when selecting this
completion.
|
CompletionCollector.Builder |
additionalTextEdits(java.util.function.Supplier<List<TextEdit>> additionalTextEdits)
A list of additional text edits that are applied when selecting this
completion.
|
CompletionCollector.Builder |
addTag(Completion.Tag tag)
Adds tag for this completion.
|
Completion |
build()
Builds completion.
|
CompletionCollector.Builder |
command(Command command)
An optional command that is executed after inserting this completion.
|
CompletionCollector.Builder |
detail(String detail)
A human-readable string with additional information about this completion,
like type or symbol information.
|
CompletionCollector.Builder |
detail(java.util.function.Supplier<String> detail)
A human-readable string with additional information about this completion,
like type or symbol information.
|
CompletionCollector.Builder |
documentation(String documentation)
A human-readable string that represents a doc-comment.
|
CompletionCollector.Builder |
documentation(java.util.function.Supplier<String> documentation)
A human-readable string that represents a doc-comment.
|
CompletionCollector.Builder |
filterText(String filterText)
A string that should be used when filtering a set of completions.
|
CompletionCollector.Builder |
insertText(String insertText)
A string that should be inserted into a document when selecting
this completion.
|
CompletionCollector.Builder |
insertTextFormat(Completion.TextFormat insertTextFormat)
The format of the insert text.
|
CompletionCollector.Builder |
kind(Completion.Kind kind)
The kind of this completion.
|
CompletionCollector.Builder |
label(String label)
The label of this completion.
|
CompletionCollector.Builder |
preselect(boolean preselect)
Select this completion when showing.
|
CompletionCollector.Builder |
sortText(String sortText)
A string that should be used when comparing this completion with other
completions.
|
CompletionCollector.Builder |
textEdit(TextEdit textEdit)
An edit which is applied to a document when selecting this completion.
|
@NonNull public CompletionCollector.Builder label(@NonNull String label)
@NonNull public CompletionCollector.Builder kind(@NonNull Completion.Kind kind)
@NonNull public CompletionCollector.Builder addTag(@NonNull Completion.Tag tag)
@NonNull public CompletionCollector.Builder detail(@NonNull String detail)
CompletionCollector.Builder.detail(java.util.function.Supplier)
to defer
computation to the subsequent completionItem/resolve
request.@NonNull public CompletionCollector.Builder detail(@NonNull java.util.function.Supplier<String> detail)
completionItem/resolve
request.@NonNull public CompletionCollector.Builder documentation(@NonNull String documentation)
CompletionCollector.Builder.documentation(java.util.function.Supplier)
to
defer computation to the subsequent completionItem/resolve
request.@NonNull public CompletionCollector.Builder documentation(@NonNull java.util.function.Supplier<String> documentation)
completionItem/resolve
request.@NonNull public CompletionCollector.Builder preselect(boolean preselect)
@NonNull public CompletionCollector.Builder sortText(@NonNull String sortText)
null
the label is used as the sort text.@NonNull public CompletionCollector.Builder filterText(@NonNull String filterText)
null
the label is used as the filter.@NonNull public CompletionCollector.Builder insertText(@NonNull String insertText)
null
the label is used as the insert text.@NonNull public CompletionCollector.Builder insertTextFormat(@NonNull Completion.TextFormat insertTextFormat)
insertText
property and the newText
property of a provided
textEdit
. If omitted defaults to Completion.TextFormat.PlainText
.@NonNull public CompletionCollector.Builder textEdit(@NonNull TextEdit textEdit)
insertText
is ignored.
The range of the edit must be a single line range and it must
contain the position at which completion has been requested.@NonNull public CompletionCollector.Builder command(@NonNull Command command)
@NonNull public CompletionCollector.Builder additionalTextEdits(@NonNull List<TextEdit> additionalTextEdits)
CompletionCollector.Builder.additionalTextEdits(java.util.function.Supplier)
to defer
computation to the subsequent completionItem/resolve
request.@NonNull public CompletionCollector.Builder additionalTextEdits(@NonNull java.util.function.Supplier<List<TextEdit>> additionalTextEdits)
completionItem/resolve
request.@NonNull public CompletionCollector.Builder addCommitCharacter(char commitCharacter)
@NonNull public Completion build()