Module Debug_protocol.Completion_item

type t = {
label : string;

The label of this completion item. By default this is also the text that is inserted when selecting this completion.

text : string option;

If text is not falsy then it is inserted instead of the label.

sort_text : string option;

A string that should be used when comparing this item with other items. When `falsy` the label is used.

type_ : Completion_item_type.t option;

The item's type. Typically the client uses this information to render the item in the UI with an icon.

start : int option;

This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added. If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.

length : int option;

This value determines how many characters are overwritten by the completion text. If missing the value 0 is assumed which results in the completion text being inserted.

selection_start : int option;

Determines the start of the new selection after the text has been inserted (or replaced). The start position must in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text.

selection_length : int option;

Determines the length of the new selection after the text has been inserted (or replaced). The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0.

}

CompletionItems are the suggestions returned from the CompletionsRequest.

val make : label:string -> ?⁠text:string option -> ?⁠sort_text:string option -> ?⁠type_:Completion_item_type.t option -> ?⁠start:int option -> ?⁠length:int option -> ?⁠selection_start:int option -> ?⁠selection_length:int option -> unit -> t
val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or