package ocp-index

  1. Overview
  2. Docs

Main types

type t

Lazy trie structure holding the info on all identifiers

type orig_file = private IndexTypes.orig_file =
  1. | Cmt of string
  2. | Cmti of string
  3. | Cmi of string

The type of files we get our data from

exception Bad_format of string
type info = private IndexTypes.info = {
  1. path : string list;
  2. orig_path : string list;
  3. kind : kind;
  4. name : string;
  5. ty : IndexTypes.ty option;
  6. loc_sig : Location.t Lazy.t;
  7. loc_impl : Location.t Lazy.t;
  8. doc : string option Lazy.t;
  9. file : orig_file;
}

Contains the information on a given identifier

and kind = private IndexTypes.kind =
  1. | Type
  2. | Value
  3. | Exception
  4. | OpenType
  5. | Field of info
  6. | Variant of info
  7. | Method of info
  8. | Module
  9. | ModuleType
  10. | Class
  11. | ClassType
  12. | Keyword

The kind of elements that can be stored in the trie

Utility functions

module Misc : sig ... end

Building

val load : qualify:bool -> string list -> t
val add_file : qualify:bool -> t -> string -> t

Load a single file into a trie

val open_module : ?cleanup_path:bool -> t -> string list -> t
val fully_open_module : ?cleanup_path:bool -> qualify:bool -> t -> string list -> t
val alias : ?cleanup_path:bool -> t -> string list -> string list -> t

Querying

val all : t -> info list

Returns all bindings in the trie

val get : t -> string -> info

Lookup an identifier in a trie (eg. option or List.map)

val get_all : t -> string -> info list
val complete : t -> ?filter:(info -> bool) -> string -> info list

Output

include module type of IndexOut
module Format : sig ... end
module Print : sig ... end