Module Ocaml_typing.EnvSource

Sourcetype value_unbound_reason =
  1. | Val_unbound_instance_variable
  2. | Val_unbound_self
  3. | Val_unbound_ancestor
  4. | Val_unbound_ghost_recursive of Ocaml_parsing.Location.t
Sourcetype module_unbound_reason =
  1. | Mod_unbound_illegal_recursion
Sourcetype summary =
  1. | Env_empty
  2. | Env_value of summary * Ident.t * Types.value_description
  3. | Env_type of summary * Ident.t * Types.type_declaration
  4. | Env_extension of summary * Ident.t * Types.extension_constructor
  5. | Env_module of summary * Ident.t * Types.module_presence * Types.module_declaration
  6. | Env_modtype of summary * Ident.t * Types.modtype_declaration
  7. | Env_class of summary * Ident.t * Types.class_declaration
  8. | Env_cltype of summary * Ident.t * Types.class_type_declaration
  9. | Env_open of summary * Path.t
    (*

    The string set argument of Env_open represents a list of module names to skip, i.e. that won't be imported in the toplevel namespace.

    *)
  10. | Env_functor_arg of summary * Ident.t
  11. | Env_constraints of summary * Types.type_declaration Path.Map.t
  12. | Env_copy_types of summary
  13. | Env_persistent of summary * Ident.t
  14. | Env_value_unbound of summary * string * value_unbound_reason
  15. | Env_module_unbound of summary * string * module_unbound_reason
Sourcetype address =
  1. | Aident of Ident.t
  2. | Adot of address * int
Sourcetype t
Sourceval empty : t
Sourceval initial : t
Sourceval diff : t -> t -> Ident.t list
Sourcetype type_descriptions = type_descr_kind
Sourcetype iter_cont
Sourceval iter_types : (Path.t -> (Path.t * Types.type_declaration) -> unit) -> t -> iter_cont
Sourceval run_iter_cont : iter_cont list -> (Path.t * iter_cont) list
Sourceval same_types : t -> t -> bool
Sourceval used_persistent : unit -> Merlin_utils.Misc.String.Set.t
Sourceval find_shadowed_types : Path.t -> t -> Path.t list
Sourceval without_cmis : ('a -> 'b) -> 'a -> 'b
Sourceval find_value : Path.t -> t -> Types.value_description
Sourceval find_type : Path.t -> t -> Types.type_declaration
Sourceval find_type_descrs : Path.t -> t -> type_descriptions
Sourceval find_module : Path.t -> t -> Types.module_declaration
Sourceval find_modtype : Path.t -> t -> Types.modtype_declaration
Sourceval find_class : Path.t -> t -> Types.class_declaration
Sourceval find_strengthened_module : aliasable:bool -> Path.t -> t -> Types.module_type
Sourceval find_ident_constructor : Ident.t -> t -> Types.constructor_description
Sourceval find_ident_label : Ident.t -> t -> Types.label_description
Sourceval find_type_expansion : Path.t -> t -> Types.type_expr list * Types.type_expr * int
Sourceval find_type_expansion_opt : Path.t -> t -> Types.type_expr list * Types.type_expr * int
Sourceval find_modtype_expansion : Path.t -> t -> Types.module_type
Sourceval find_modtype_expansion_lazy : Path.t -> t -> Subst.Lazy.modtype
Sourceval find_hash_type : Path.t -> t -> Types.type_declaration
Sourceval find_value_address : Path.t -> t -> address
Sourceval find_module_address : Path.t -> t -> address
Sourceval find_class_address : Path.t -> t -> address
Sourceval find_constructor_address : Path.t -> t -> address
Sourceval shape_of_path : namespace:Shape.Sig_component_kind.t -> t -> Path.t -> Shape.t
Sourceval add_functor_arg : Ident.t -> t -> t
Sourceval is_functor_arg : Path.t -> t -> bool
Sourceval normalize_module_path : Ocaml_parsing.Location.t option -> t -> Path.t -> Path.t
Sourceval normalize_type_path : Ocaml_parsing.Location.t option -> t -> Path.t -> Path.t
Sourceval normalize_value_path : Ocaml_parsing.Location.t option -> t -> Path.t -> Path.t
Sourceval normalize_modtype_path : t -> Path.t -> Path.t
Sourceval reset_required_globals : unit -> unit
Sourceval get_required_globals : unit -> Ident.t list
Sourceval add_required_global : Ident.t -> unit
Sourceval has_local_constraints : t -> bool
Sourceval mark_value_used : Ocaml_typing.Types.Uid.t -> unit
Sourceval mark_module_used : Ocaml_typing.Types.Uid.t -> unit
Sourceval mark_type_used : Ocaml_typing.Types.Uid.t -> unit
Sourcetype constructor_usage =
  1. | Positive
  2. | Pattern
  3. | Exported_private
  4. | Exported
Sourceval mark_constructor_used : constructor_usage -> Types.constructor_declaration -> unit
Sourceval mark_extension_used : constructor_usage -> Types.extension_constructor -> unit
Sourcetype label_usage =
  1. | Projection
  2. | Mutation
  3. | Construct
  4. | Exported_private
  5. | Exported
Sourceval mark_label_used : label_usage -> Types.label_declaration -> unit
Sourcetype unbound_value_hint =
  1. | No_hint
  2. | Missing_rec of Ocaml_parsing.Location.t
Sourcetype lookup_error =
  1. | Unbound_value of Ocaml_parsing.Longident.t * unbound_value_hint
  2. | Unbound_type of Ocaml_parsing.Longident.t
  3. | Unbound_constructor of Ocaml_parsing.Longident.t
  4. | Unbound_label of Ocaml_parsing.Longident.t
  5. | Unbound_module of Ocaml_parsing.Longident.t
  6. | Unbound_class of Ocaml_parsing.Longident.t
  7. | Unbound_modtype of Ocaml_parsing.Longident.t
  8. | Unbound_cltype of Ocaml_parsing.Longident.t
  9. | Unbound_instance_variable of string
  10. | Not_an_instance_variable of string
  11. | Masked_instance_variable of Ocaml_parsing.Longident.t
  12. | Masked_self_variable of Ocaml_parsing.Longident.t
  13. | Masked_ancestor_variable of Ocaml_parsing.Longident.t
  14. | Structure_used_as_functor of Ocaml_parsing.Longident.t
  15. | Abstract_used_as_functor of Ocaml_parsing.Longident.t
  16. | Functor_used_as_structure of Ocaml_parsing.Longident.t
  17. | Abstract_used_as_structure of Ocaml_parsing.Longident.t
  18. | Generative_used_as_applicative of Ocaml_parsing.Longident.t
  19. | Illegal_reference_to_recursive_module
  20. | Cannot_scrape_alias of Ocaml_parsing.Longident.t * Path.t
Sourceval lookup_error : Ocaml_parsing.Location.t -> t -> lookup_error -> 'a
Sourceval lookup_module_path : ?use:bool -> loc:Ocaml_parsing.Location.t -> load:bool -> Ocaml_parsing.Longident.t -> t -> Path.t
Sourceval lookup_modtype_path : ?use:bool -> loc:Ocaml_parsing.Location.t -> Ocaml_parsing.Longident.t -> t -> Path.t
Sourceval lookup_all_constructors : ?use:bool -> loc:Ocaml_parsing.Location.t -> constructor_usage -> Ocaml_parsing.Longident.t -> t -> ((Types.constructor_description * (unit -> unit)) list, Ocaml_parsing.Location.t * t * lookup_error) result
Sourceval lookup_all_constructors_from_type : ?use:bool -> loc:Ocaml_parsing.Location.t -> constructor_usage -> Path.t -> t -> (Types.constructor_description * (unit -> unit)) list
Sourceval lookup_all_labels : ?use:bool -> loc:Ocaml_parsing.Location.t -> label_usage -> Ocaml_parsing.Longident.t -> t -> ((Types.label_description * (unit -> unit)) list, Ocaml_parsing.Location.t * t * lookup_error) result
Sourceval lookup_all_labels_from_type : ?use:bool -> loc:Ocaml_parsing.Location.t -> label_usage -> Path.t -> t -> (Types.label_description * (unit -> unit)) list
Sourceval lookup_instance_variable : ?use:bool -> loc:Ocaml_parsing.Location.t -> string -> t -> Path.t * Ocaml_parsing.Asttypes.mutable_flag * string * Types.type_expr
Sourceval find_value_index : Ident.t -> t -> int option

The find_*_index functions computes a "namespaced" De Bruijn index of an identifier in a given environment. In other words, it returns how many times an identifier has been shadowed by a more recent identifiers with the same name in a given environment. Those functions return None when the identifier is not bound in the environment. This behavior is there to facilitate the detection of inconsistent printing environment, but should disappear in the long term.

Sourceval find_type_index : Ident.t -> t -> int option
Sourceval find_module_index : Ident.t -> t -> int option
Sourceval find_modtype_index : Ident.t -> t -> int option
Sourceval find_class_index : Ident.t -> t -> int option
Sourceval find_cltype_index : Ident.t -> t -> int option
Sourceval bound_value : string -> t -> bool
Sourceval bound_module : string -> t -> bool
Sourceval bound_type : string -> t -> bool
Sourceval bound_modtype : string -> t -> bool
Sourceval bound_class : string -> t -> bool
Sourceval bound_cltype : string -> t -> bool
Sourceval make_copy_of_types : t -> t -> t
Sourceval add_value : ?check:(string -> Ocaml_utils.Warnings.t) -> Ident.t -> Types.value_description -> t -> t
Sourceval add_type : check:bool -> Ident.t -> Types.type_declaration -> t -> t
Sourceval add_type_long_path : check:bool -> Ident.t -> Types.type_declaration -> t -> t
Sourceval add_extension : check:bool -> rebind:bool -> Ident.t -> Types.extension_constructor -> t -> t
Sourceval add_module : ?arg:bool -> ?shape:Shape.t -> Ident.t -> Types.module_presence -> Types.module_type -> t -> t
Sourceval add_module_lazy : update_summary:bool -> Ident.t -> Types.module_presence -> Subst.Lazy.modtype -> t -> t
Sourceval add_module_declaration : ?arg:bool -> ?shape:Shape.t -> check:bool -> Ident.t -> Types.module_presence -> Types.module_declaration -> t -> t
Sourceval add_module_declaration_lazy : update_summary:bool -> Ident.t -> Types.module_presence -> Subst.Lazy.module_decl -> t -> t
Sourceval add_modtype : Ident.t -> Types.modtype_declaration -> t -> t
Sourceval add_modtype_lazy : update_summary:bool -> Ident.t -> Subst.Lazy.modtype_declaration -> t -> t
Sourceval add_class : Ident.t -> Types.class_declaration -> t -> t
Sourceval add_cltype : Ident.t -> Types.class_type_declaration -> t -> t
Sourceval add_local_type : Path.t -> Types.type_declaration -> t -> t
Sourceval add_persistent_structure : Ident.t -> t -> t
Sourceval filter_non_loaded_persistent : (Ident.t -> bool) -> t -> t
Sourceval add_signature : Types.signature -> t -> t
Sourceval open_signature : ?used_slot:bool ref -> ?loc:Ocaml_parsing.Location.t -> ?toplevel:bool -> Ocaml_parsing.Asttypes.override_flag -> Path.t -> t -> (t, [ `Not_found | `Functor ]) result
Sourceval open_pers_signature : string -> t -> (t, [ `Not_found ]) result
Sourceval remove_last_open : Path.t -> t -> t option
Sourceval enter_value : ?check:(string -> Ocaml_utils.Warnings.t) -> string -> Types.value_description -> t -> Ident.t * t
Sourceval enter_type : scope:int -> string -> Types.type_declaration -> t -> Ident.t * t
Sourceval enter_extension : scope:int -> rebind:bool -> string -> Types.extension_constructor -> t -> Ident.t * t
Sourceval enter_module : scope:int -> ?arg:bool -> string -> Types.module_presence -> Types.module_type -> t -> Ident.t * t
Sourceval enter_module_declaration : scope:int -> ?arg:bool -> ?shape:Shape.t -> string -> Types.module_presence -> Types.module_declaration -> t -> Ident.t * t
Sourceval enter_modtype : scope:int -> string -> Types.modtype_declaration -> t -> Ident.t * t
Sourceval enter_class : scope:int -> string -> Types.class_declaration -> t -> Ident.t * t
Sourceval enter_cltype : scope:int -> string -> Types.class_type_declaration -> t -> Ident.t * t
Sourceval enter_signature : ?mod_shape:Shape.t -> scope:int -> Types.signature -> t -> Types.signature * t
Sourceval enter_signature_and_shape : scope:int -> parent_shape:Shape.Map.t -> Shape.t -> Types.signature -> t -> Types.signature * Shape.Map.t * t
Sourceval enter_unbound_value : string -> value_unbound_reason -> t -> t
Sourceval enter_unbound_module : string -> module_unbound_reason -> t -> t
Sourceval reset_cache : unit -> unit
Sourceval reset_cache_toplevel : unit -> unit
Sourceval set_unit_name : string -> unit
Sourceval get_unit_name : unit -> string
Sourceval imports : unit -> Merlin_utils.Misc.crcs
Sourceval import_crcs : source:string -> Merlin_utils.Misc.crcs -> unit
Sourceval is_imported_opaque : Merlin_utils.Misc.modname -> bool
Sourceval register_import_as_opaque : Merlin_utils.Misc.modname -> unit
Sourceval summary : t -> summary
Sourceval keep_only_summary : t -> t
Sourceval env_of_only_summary : (summary -> Subst.t -> t) -> t -> t
Sourceval update_short_paths : t -> t
Sourceval short_paths : t -> Short_paths.t
Sourcetype error =
  1. | Missing_module of Ocaml_parsing.Location.t * Path.t * Path.t
  2. | Illegal_value_name of Ocaml_parsing.Location.t * string
  3. | Lookup_error of Ocaml_parsing.Location.t * t * lookup_error
Sourceexception Error of error
Sourceval report_error : Format.formatter -> error -> unit
Sourceval report_lookup_error : Ocaml_parsing.Location.t -> t -> Format.formatter -> lookup_error -> unit
Sourceval in_signature : bool -> t -> t
Sourceval is_in_signature : t -> bool
Sourceval set_value_used_callback : Types.value_description -> (unit -> unit) -> unit
Sourceval set_type_used_callback : Types.type_declaration -> ((unit -> unit) -> unit) -> unit
Sourceval check_functor_application : (errors:bool -> loc:Ocaml_parsing.Location.t -> lid_whole_app:Ocaml_parsing.Longident.t -> f0_path:Path.t -> args:(Path.t * Types.module_type) list -> arg_path:Path.t -> arg_mty:Types.module_type -> param_mty:Types.module_type -> t -> unit) ref
Sourceval check_well_formed_module : (t -> Ocaml_parsing.Location.t -> string -> Types.module_type -> unit) ref
Sourceval add_delayed_check_forward : ((unit -> unit) -> unit) ref
Sourceval strengthen : (aliasable:bool -> t -> Subst.Lazy.modtype -> Path.t -> Subst.Lazy.modtype) ref
Sourceval same_constr : (t -> Types.type_expr -> Types.type_expr -> bool) ref
Sourceval print_longident : (Format.formatter -> Ocaml_parsing.Longident.t -> unit) ref
Sourceval print_path : (Format.formatter -> Path.t -> unit) ref
Sourceval shorten_module_path : (t -> Path.t -> Path.t) ref

Folds

Folding over all identifiers (for analysis purpose)

Sourceval fold_values : (string -> Path.t -> Types.value_description -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_types : (string -> Path.t -> Types.type_declaration -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_constructors : (Types.constructor_description -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_labels : (Types.label_description -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_modules : (string -> Path.t -> Types.module_declaration -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a

Persistent structures are only traversed if they are already loaded.

Sourceval fold_modtypes : (string -> Path.t -> Types.modtype_declaration -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_classes : (string -> Path.t -> Types.class_declaration -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a
Sourceval fold_cltypes : (string -> Path.t -> Types.class_type_declaration -> 'a -> 'a) -> Ocaml_parsing.Longident.t option -> t -> 'a -> 'a

Utilities

Sourceval check_value_name : string -> Ocaml_parsing.Location.t -> unit
Sourceval print_address : Format.formatter -> address -> unit
Sourceval unbound_class : Path.t

merlin: manage internal state

Sourceval check_state_consistency : unit -> bool
Sourceval with_cmis : (unit -> 'a) -> 'a
Sourceval add_merlin_extension_module : Ident.t -> Types.module_type -> t -> t
Sourceval cleanup_functor_caches : stamp:int -> unit