Module Imandra_surface.Completion

Tab-Completion

type event = Event.t
type str_set = unit Imandra_util.Util.Str_tbl.t
type t = {
ev : event;
id : Uid.t option;
text : string;
cost : int;
}
type 'a within_ctx = {
start : int;
stop : int;
x : 'a;
}
type source_kind =
| Src_string
| Src_id
| Src_attr
type source = {
src_name : string;
src_kind : source_kind;
src_complete : seen:str_set -> pred:(string -> string -> bool) -> string -> t list;
}

A source of completions

val register : source -> unit
val complete : ?⁠pred:(string -> string -> bool) -> string -> cursor_pos:int -> t list within_ctx

Helpers to build sources

val mk : ?⁠id:Uid.t -> ?⁠cost:int -> string -> event -> t
module Inspect : sig ... end