Module Merlin

val string_of_bool : bool -> string

Merlin

type t = {
  1. server : bool;
  2. bin_path : string;
  3. dot_merlin : string;
  4. context : Core.Buffer.t;
}
val create : ?server:bool -> ?bin_path:string -> ?dot_merlin:string -> unit -> t
val add_context : t -> string -> unit
val call : < process_mgr : [> [> `Generic ] Eio.Process.mgr_ty ] Eio.Process.mgr.. > -> t -> string -> string list -> string -> string

Top-level merlin replies

type merlin_reply_body = {
  1. klass : string;
  2. value : string;
  3. notifications : string list;
}
val merlin_reply_body_of_jsonaf : Ppx_jsonaf_conv_lib.Jsonaf_kernel.t -> merlin_reply_body
val jsonaf_of_merlin_reply_body : merlin_reply_body -> Ppx_jsonaf_conv_lib.Jsonaf_kernel.t
val parse_merlin_reply : string -> merlin_reply_body

Detection of identifiers

type ident_position = {
  1. id_line : int;
  2. id_col : int;
}
val ident_position_of_jsonaf : Ppx_jsonaf_conv_lib.Jsonaf_kernel.t -> ident_position
val jsonaf_of_ident_position : ident_position -> Ppx_jsonaf_conv_lib.Jsonaf_kernel.t
type ident_reply = {
  1. id_start : ident_position;
  2. id_end : ident_position;
}
val ident_reply_of_jsonaf : Ppx_jsonaf_conv_lib.Jsonaf_kernel.t -> ident_reply
val jsonaf_of_ident_reply : ident_reply -> Ppx_jsonaf_conv_lib.Jsonaf_kernel.t
val occurrences : < process_mgr : [> [> `Generic ] Eio.Process.mgr_ty ] Eio.Process.mgr.. > -> pos:int -> t -> string -> ident_reply list
val abs_position : string -> ident_position -> int

Completion

type kind =
  1. | CMPL_VALUE
  2. | CMPL_VARIANT
  3. | CMPL_CONSTR
  4. | CMPL_LABEL
  5. | CMPL_MODULE
  6. | CMPL_SIG
  7. | CMPL_TYPE
  8. | CMPL_METHOD
  9. | CMPL_METHOD_CALL
  10. | CMPL_EXN
  11. | CMPL_CLASS
type candidate = {
  1. cmpl_name : string;
  2. cmpl_kind : kind;
  3. cmpl_type : string;
  4. cmpl_doc : string;
}
val candidate_of_jsonaf : Ppx_jsonaf_conv_lib.Jsonaf_kernel.t -> candidate
val jsonaf_of_candidate : candidate -> Ppx_jsonaf_conv_lib.Jsonaf_kernel.t
type reply = {
  1. cmpl_candidates : candidate list;
  2. cmpl_start : int;
  3. cmpl_end : int;
}
val empty : reply
val rfind_prefix_start : string -> int -> int
val find_cmpl_end : string -> int -> int
val complete : < process_mgr : [> [> `Generic ] Eio.Process.mgr_ty ] Eio.Process.mgr.. > -> ?doc:bool -> ?types:bool -> pos:int -> t -> string -> reply