Module ProtocolSource

Sourcetype source = string

CMIs are provided either statically or as URLs to be downloaded on demand

Dynamic cmis are loaded from beneath the given url. In addition the top-level modules are specified, and prefixes for other modules. For example, for the OCaml standard library, a user might pass:

  {
    dcs_url = "/static/stdlib";
    dcs_toplevel_modules = [ "Stdlib" ];
    dcs_file_prefixes = [ "stdlib__" ];
  }

In which case, merlin will expect to be able to download a valid file from the url "/static/stdlib/stdlib.cmi" corresponding to the specified toplevel module, and it will also attempt to download any module with the prefix "Stdlib__" from the same base url, so for example if an attempt is made to look up the module "Stdlib__Foo" then merlin-js will attempt to download a file from the url "/static/stdlib/stdlib__Foo.cmi".

Sourcetype dynamic_cmis = {
  1. dcs_url : string;
  2. dcs_toplevel_modules : string list;
  3. dcs_file_prefixes : string list;
}
Sourcetype static_cmi = {
  1. sc_name : string;
  2. sc_content : string;
}
Sourcetype cmis = {
  1. static_cmis : static_cmi list;
  2. dynamic_cmis : dynamic_cmis option;
}
Sourcetype action =
  1. | Complete_prefix of source * Merlin_kernel.Msource.position
  2. | Type_enclosing of source * Merlin_kernel.Msource.position
  3. | All_errors of source
  4. | Add_cmis of cmis
Sourcetype error = {
  1. kind : Location.report_kind;
  2. loc : Location.t;
  3. main : string;
  4. sub : string list;
  5. source : Location.error_source;
}
Sourcetype completions = {
  1. from : int;
  2. to_ : int;
  3. entries : Query_protocol.Compl.entry list;
}
Sourcetype is_tail_position = [
  1. | `No
  2. | `Tail_position
  3. | `Tail_call
]
Sourcetype answer =
  1. | Errors of error list
  2. | Completions of completions
  3. | Typed_enclosings of (Location.t * [ `Index of int | `String of string ] * is_tail_position) list
  4. | Added_cmis
Sourceval report_source_to_string : Location.error_source -> string