class LSProtocol::CompletionList
- LSProtocol::CompletionList
- Reference
- Object
Overview
Represents a collection of CompletionItem
to be presented
in the editor.
Included Modules
- JSON::Serializable
Defined in:
lsprotocol/types.crConstructors
- .new(is_incomplete : Bool | Nil, items : Array(CompletionItem) | Nil, apply_kind : CompletionItemApplyKinds | Nil = nil, item_defaults : CompletionItemDefaults | Nil = nil)
- .new(pull : JSON::PullParser)
Instance Method Summary
-
#apply_kind : CompletionItemApplyKinds | Nil
Specifies how fields from a completion item should be combined with those from
completionList.itemDefaults
. -
#is_incomplete : Bool
This list it not complete.
-
#item_defaults : CompletionItemDefaults | Nil
In many cases the items of an actual completion result share the same value for properties like
commitCharacters
or the range of a text edit. -
#items : Array(CompletionItem)
The completion items.
Constructor Detail
Instance Method Detail
Specifies how fields from a completion item should be combined with those
from completionList.itemDefaults
.
If unspecified, all fields will be treated as ApplyKind.Replace.
If a field's value is ApplyKind.Replace, the value from a completion item
(if provided and not null
) will always be used instead of the value
from completionItem.itemDefaults
.
If a field's value is ApplyKind.Merge, the values will be merged using the rules defined against each field below.
Servers are only allowed to return applyKind
if the client
signals support for this via the completionList.applyKindSupport
capability.
@since 3.18.0
This list it not complete. Further typing results in recomputing this list.
Recomputed lists have all their items replaced (not appended) in the incomplete completion sessions.
In many cases the items of an actual completion result share the same
value for properties like commitCharacters
or the range of a text
edit. A completion list can therefore define item defaults which will
be used if a completion item itself doesn't specify the value.
If a completion list specifies a default value and a completion item
also specifies a corresponding value, the rules for combining these are
defined by applyKinds
(if the client supports it), defaulting to
ApplyKind.Replace.
Servers are only allowed to return default values if the client
signals support for this via the completionList.itemDefaults
capability.
@since 3.17.0