class LSProtocol::CompletionList

Overview

Represents a collection of CompletionItem to be presented in the editor.

Included Modules

Defined in:

lsprotocol/types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(is_incomplete : Bool | Nil, items : Array(CompletionItem) | Nil, apply_kind : CompletionItemApplyKinds | Nil = nil, item_defaults : CompletionItemDefaults | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def apply_kind : CompletionItemApplyKinds | Nil #

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


[View source]
def is_incomplete : Bool #

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.


[View source]
def 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. 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


[View source]
def items : Array(CompletionItem) #

The completion items.


[View source]