Module Imandra_interactive.Completion

Tab-Completion

type event = Imandra_surface.Event.t
type str_set = unit Imandra_util.Util.Str_tbl.t
type t = {
text : string;
descr : string;
cost : int;
id : Imandra_surface.Uid.t option;
ev : event option;
}
type 'a within_ctx = {
start : int;
stop : int;
x : 'a;
}
type source_kind =
| Src_string
| Src_id
| Src_attr
type completion_ctx = {
db : Imandra_surface.Event.DB.t;
env : Env.t;
}

Context given to completion methods

type source = {
src_name : string;
src_kind : source_kind;
src_complete : completion_ctx -> seen:str_set -> pred:( string -> string -> bool ) -> string -> t list;
}

A source of completions

val register : source -> unit
val complete : ?pred:( string -> string -> bool ) -> ?kind:source_kind -> completion_ctx -> string -> t list within_ctx
val complete_at : ?pred:( string -> string -> bool ) -> completion_ctx -> string -> cursor_pos:int -> t list within_ctx
val complete_at_pos : ?pred:( string -> string -> bool ) -> completion_ctx -> string -> pos:Imandra_util.Iloc.position -> t list within_ctx

Helpers to build sources

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