class LSProtocol::CompletionItem

Overview

A completion item represents a text snippet that is proposed to complete text that is being typed.

Included Modules

Defined in:

lsprotocol/types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(label : String | Nil, additional_text_edits : Array(TextEdit) | Nil = nil, command : Command | Nil = nil, commit_characters : Array(String) | Nil = nil, data : LSPAny | Nil = nil, deprecated : Bool | Nil = nil, detail : String | Nil = nil, documentation : MarkupContent | String | Nil = nil, filter_text : String | Nil = nil, insert_text : String | Nil = nil, insert_text_format : InsertTextFormat | Nil = nil, insert_text_mode : InsertTextMode | Nil = nil, kind : CompletionItemKind | Nil = nil, label_details : CompletionItemLabelDetails | Nil = nil, preselect : Bool | Nil = nil, sort_text : String | Nil = nil, tags : Array(CompletionItemTag) | Nil = nil, text_edit : InsertReplaceEdit | TextEdit | Nil = nil, text_edit_text : String | Nil = nil) #

[View source]

Instance Method Detail

def additional_text_edits : Array(TextEdit) | Nil #

[View source]
def command : Command | Nil #

An optional Command that is executed after inserting this completion. Note that additional modifications to the current document should be described with the CompletionItem#additionalTextEdits-property.


[View source]
def commit_characters : Array(String) | Nil #

[View source]
def data : LSPAny | Nil #

A data entry field that is preserved on a completion item between a CompletionRequest and a CompletionResolveRequest.


[View source]
def deprecated : Bool | Nil #

Indicates if this item is deprecated. @deprecated Use #tags instead.


[View source]
def detail : String | Nil #

A human-readable string with additional information about this item, like type or symbol information.


[View source]
def documentation : MarkupContent | String | Nil #

A human-readable string that represents a doc-comment.


[View source]
def filter_text : String | Nil #

[View source]
def insert_text : String | Nil #

[View source]
def insert_text_format : InsertTextFormat | Nil #

[View source]
def insert_text_mode : InsertTextMode | Nil #

[View source]
def kind : CompletionItemKind | Nil #

The kind of this completion item. Based of the kind an icon is chosen by the editor.


[View source]
def label : String #

The label of this completion item.

The label property is also by default the text that is inserted when selecting this completion.

If label details are provided the label itself should be an unqualified name of the completion item.


[View source]
def label_details : CompletionItemLabelDetails | Nil #

[View source]
def preselect : Bool | Nil #

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.


[View source]
def sort_text : String | Nil #

[View source]
def tags : Array(CompletionItemTag) | Nil #

Tags for this completion item.

@since 3.15.0


[View source]
def text_edit : InsertReplaceEdit | TextEdit | Nil #

[View source]
def text_edit_text : String | Nil #

[View source]