Ocaml_typing.Envtype value_unbound_reason = | Val_unbound_instance_variable| Val_unbound_self| Val_unbound_ancestor| Val_unbound_ghost_recursive of Ocaml_parsing.Location.ttype summary = | Env_empty| Env_value of summary * Ident.t * Types.value_description * Mode.Value.l| Env_type of summary * Ident.t * Types.type_declaration| Env_extension of summary * Ident.t * Types.extension_constructor| Env_module of summary
* Ident.t
* Types.module_presence
* Types.module_declaration
* Mode.Value.l
* locks| Env_modtype of summary * Ident.t * Types.modtype_declaration| Env_class of summary * Ident.t * Types.class_declaration| Env_cltype of summary * Ident.t * Types.class_type_declaration| Env_open of summary * Path.tThe 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.
| Env_functor_arg of summary * Ident.t| Env_constraints of summary * Types.type_declaration Path.Map.t| Env_copy_types of summary| Env_persistent of summary * Ident.t| Env_value_unbound of summary * string * value_unbound_reason| Env_module_unbound of summary * string * module_unbound_reasontype address = Persistent_env.address = | Aunit of Compilation_unit.t| Alocal of Ident.t| Adot of address * Jkind.Sort.t array * intval empty : ttype type_descr_kind =
(Types.label_description,
Types.unboxed_label_description,
Types.constructor_description)
Types.type_kindtype type_descriptions = type_descr_kindval iter_types :
(Path.t -> (Path.t * Types.type_declaration) -> unit) ->
t ->
iter_contval used_persistent : unit -> Compilation_unit.Name.Set.tval find_value_no_locks_exn :
Ident.t ->
t ->
Subst.Lazy.value_description * Mode.Value.lFind a value by an Ident.t. Raises if encounters any locks.
val find_value : Path.t -> t -> Subst.Lazy.value_descriptionval find_type : Path.t -> t -> Types.type_declarationval find_type_descrs : Path.t -> t -> type_descriptionsval find_module_lazy : Path.t -> t -> Subst.Lazy.module_declarationval find_module : Path.t -> t -> Types.module_declarationval find_modtype_lazy : Path.t -> t -> Subst.Lazy.modtype_declarationval find_modtype : Path.t -> t -> Types.modtype_declarationval find_class : Path.t -> t -> Types.class_declarationval find_cltype : Path.t -> t -> Types.class_type_declarationval find_ident_constructor : Ident.t -> t -> Types.constructor_descriptionval find_ident_label :
'rcd Types.record_form ->
Ident.t ->
t ->
'rcd Types.gen_label_descriptionval find_type_expansion :
Path.t ->
t ->
Types.type_expr list * Types.type_expr * intval find_type_expansion_opt :
Path.t ->
t ->
Types.type_expr list * Types.type_expr * intval find_modtype_expansion : Path.t -> t -> Types.module_typeval find_modtype_expansion_lazy : Path.t -> t -> Subst.Lazy.module_typeval find_hash_type : Path.t -> t -> Types.type_declarationval shape_of_path :
namespace:Shape.Sig_component_kind.t ->
t ->
Path.t ->
Shape.tval shape_of_path_opt :
namespace:Shape.Sig_component_kind.t ->
t ->
Path.t ->
Shape.t optionval normalize_module_path :
Ocaml_parsing.Location.t option ->
t ->
Path.t ->
Path.tval normalize_type_path :
Ocaml_parsing.Location.t option ->
t ->
Path.t ->
Path.tval normalize_value_path :
Ocaml_parsing.Location.t option ->
t ->
Path.t ->
Path.tval get_required_globals : unit -> Compilation_unit.t listval has_local_constraints : t -> boolval mark_value_used : Ocaml_typing.Types.Uid.t -> unitval mark_module_used : Ocaml_typing.Types.Uid.t -> unitval mark_type_used : Ocaml_typing.Types.Uid.t -> unitval mark_value_mutated : Ocaml_typing.Types.Uid.t -> unitval mark_constructor_used :
constructor_usage ->
Ocaml_typing.Types.Uid.t ->
unitval mark_extension_used : constructor_usage -> Ocaml_typing.Types.Uid.t -> unitval mark_label_used : label_usage -> Ocaml_typing.Types.Uid.t -> unittype mode_with_locks = Mode.Value.l * locksSometimes we get the locks for something, but either want to walk them later, or walk them for something else. The Longident.t and Location.t are only for error messages, and point to the variable for which we actually want to walk the locks.
val locks_empty : locksval locks_is_empty : locks -> boolval mode_unit : Mode.Value.lrtype lookup_error = | Unbound_value of Ocaml_parsing.Longident.t * unbound_value_hint| Unbound_type of Ocaml_parsing.Longident.t| Unbound_constructor of Ocaml_parsing.Longident.t| Unbound_label of Ocaml_parsing.Longident.t
* Types.record_form_packed
* label_usage| Unbound_module of Ocaml_parsing.Longident.t| Unbound_class of Ocaml_parsing.Longident.t| Unbound_modtype of Ocaml_parsing.Longident.t| Unbound_cltype of Ocaml_parsing.Longident.t| Unbound_settable_variable of string| Not_a_settable_variable of string| Masked_instance_variable of Ocaml_parsing.Longident.t| Masked_self_variable of Ocaml_parsing.Longident.t| Masked_ancestor_variable of Ocaml_parsing.Longident.t| Structure_used_as_functor of Ocaml_parsing.Longident.t| Abstract_used_as_functor of Ocaml_parsing.Longident.t * Path.t| Functor_used_as_structure of Ocaml_parsing.Longident.t
* structure_components_reason| Abstract_used_as_structure of Ocaml_parsing.Longident.t
* Path.t
* structure_components_reason| Generative_used_as_applicative of Ocaml_parsing.Longident.t| Illegal_reference_to_recursive_module of {}| Illegal_reference_to_recursive_class_type of {container : string option;unbound : string;unbound_class_type : Ocaml_parsing.Longident.t;container_class_type : string;}| Cannot_scrape_alias of Ocaml_parsing.Longident.t * Path.t| Local_value_used_in_exclave of Ocaml_typing.Mode.Hint.lock_item
* Ocaml_parsing.Longident.t| Non_value_used_in_object of Ocaml_parsing.Longident.t
* Types.type_expr
* Jkind.Violation.t| No_unboxed_version of Ocaml_parsing.Longident.t * Types.type_declaration| Error_from_persistent_env of Persistent_env.error| Mutable_value_used_in_closure of Ocaml_typing.Mode.Hint.pinpoint| Incompatible_stage of Ocaml_parsing.Longident.t
* Ocaml_parsing.Location.t
* stage
* Ocaml_parsing.Location.t
* stage| No_constructor_in_stage of Ocaml_parsing.Longident.t
* Ocaml_parsing.Location.t
* intval lookup_error : Ocaml_parsing.Location.t -> t -> lookup_error -> 'aval walk_locks :
env:t ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
item:Ocaml_typing.Mode.Hint.lock_item ->
Types.type_expr option ->
mode_with_locks ->
Mode.Value.lTakes the mode and the type of a value at definition site, walks through the list of locks and constrains the mode and the type. Return the access mode of the value allowed by the locks. ty is optional as the function works on modules and classes as well, for which ty should be None.
val lookup_value :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.value_description * mode_with_locksval lookup_type :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.type_declarationval lookup_module :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.module_declaration * mode_with_locksval lookup_modtype :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.modtype_declarationval lookup_class :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.class_declaration * Mode.Value.lval lookup_cltype :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.class_type_declarationval lookup_module_path :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
load:bool ->
Ocaml_parsing.Longident.t ->
t ->
Path.t * mode_with_locksval lookup_modtype_path :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
Ocaml_parsing.Longident.t ->
t ->
Path.tval lookup_module_instance_path :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
load:bool ->
Global_module.Name.t ->
t ->
Path.t * locksval lookup_constructor :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
constructor_usage ->
Ocaml_parsing.Longident.t ->
t ->
Types.constructor_description * locksval lookup_all_constructors :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
constructor_usage ->
Ocaml_parsing.Longident.t ->
t ->
(((Types.constructor_description * locks) * (unit -> unit)) list,
Ocaml_parsing.Location.t * t * lookup_error)
resultval lookup_all_constructors_from_type :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
constructor_usage ->
Path.t ->
t ->
((Types.constructor_description * locks) * (unit -> unit)) listval lookup_label :
?use:bool ->
record_form:'rcd Types.record_form ->
loc:Ocaml_parsing.Location.t ->
label_usage ->
Ocaml_parsing.Longident.t ->
t ->
'rcd Types.gen_label_descriptionval lookup_all_labels :
?use:bool ->
record_form:'rcd Types.record_form ->
loc:Ocaml_parsing.Location.t ->
label_usage ->
Ocaml_parsing.Longident.t ->
t ->
(('rcd Types.gen_label_description * (unit -> unit)) list,
Ocaml_parsing.Location.t * t * lookup_error)
resultval lookup_all_labels_from_type :
?use:bool ->
record_form:'rcd Types.record_form ->
loc:Ocaml_parsing.Location.t ->
label_usage ->
Path.t ->
t ->
('rcd Types.gen_label_description * (unit -> unit)) listtype settable_variable = | Instance_variable of Path.t
* Ocaml_parsing.Asttypes.mutable_flag
* string
* Types.type_expr| Mutable_variable of Ident.t * Mode.Value.r * Types.type_expr * Jkind.Sort.tval lookup_settable_variable :
?use:bool ->
loc:Ocaml_parsing.Location.t ->
string ->
t ->
settable_variableFor a mutable variable, use means mark as mutated. For an instance variable, it means mark as used.
val find_value_by_name :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.value_descriptionval find_value_by_name_lazy :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Subst.Lazy.value_descriptionval find_type_by_name :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.type_declarationval find_module_by_name_lazy :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Subst.Lazy.module_declarationval find_modtype_by_name_lazy :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Subst.Lazy.modtype_declarationval find_class_by_name :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.class_declarationval find_cltype_by_name :
Ocaml_parsing.Longident.t ->
t ->
Path.t * Types.class_type_declarationval find_constructor_by_name :
Ocaml_parsing.Longident.t ->
t ->
Types.constructor_descriptionval find_label_by_name :
'rep Types.record_form ->
Ocaml_parsing.Longident.t ->
t ->
'rep Types.gen_label_descriptionThe 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.
val bound_value : string -> t -> boolval bound_module : string -> t -> boolval bound_type : string -> t -> boolval bound_modtype : string -> t -> boolval bound_class : string -> t -> boolval bound_cltype : string -> t -> boolval global_of_instance_compilation_unit : Compilation_unit.t -> Global_module.tval add_value_lazy :
?check:(string -> Ocaml_utils.Warnings.t) ->
mode:(Mode.allowed * 'r) Mode.Value.t ->
Ident.t ->
Subst.Lazy.value_description ->
t ->
tval add_value :
?check:(string -> Ocaml_utils.Warnings.t) ->
mode:(Mode.allowed * 'r) Mode.Value.t ->
Ident.t ->
Types.value_description ->
t ->
tval add_type :
check:bool ->
?shape:Shape.t ->
Ident.t ->
Types.type_declaration ->
t ->
tval add_type_long_path :
check:bool ->
?shape:Shape.t ->
Ident.t ->
Types.type_declaration ->
t ->
tval add_extension :
check:bool ->
?shape:Shape.t ->
rebind:bool ->
Ident.t ->
Types.extension_constructor ->
t ->
tval add_module :
?arg:bool ->
?shape:Shape.t ->
Ident.t ->
Types.module_presence ->
Types.module_type ->
?mode:Mode.Value.l ->
t ->
tval add_module_lazy :
update_summary:bool ->
Ident.t ->
Types.module_presence ->
Subst.Lazy.module_type ->
?mode:Mode.Value.l ->
t ->
tval add_module_declaration :
?arg:bool ->
?shape:Shape.t ->
check:bool ->
Ident.t ->
Types.module_presence ->
Types.module_declaration ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
?locks:locks ->
t ->
tval add_module_declaration_lazy :
?arg:bool ->
update_summary:bool ->
Ident.t ->
Types.module_presence ->
Subst.Lazy.module_declaration ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
?locks:locks ->
t ->
tval add_modtype : Ident.t -> Types.modtype_declaration -> t -> tval add_modtype_lazy :
update_summary:bool ->
Ident.t ->
Subst.Lazy.modtype_declaration ->
t ->
tval add_class : Ident.t -> Types.class_declaration -> t -> tval add_cltype : Ident.t -> Types.class_type_declaration -> t -> tval add_local_constraint : Path.t -> Types.type_declaration -> t -> tval persistent_structures_of_dir :
Ocaml_utils.Load_path.Dir.t ->
Merlin_utils.Misc.String.Set.tval persistent_structures_of_basenames :
string list ->
Merlin_utils.Misc.String.Set.tval add_signature : Types.signature -> t -> tval add_signature_lazy : Subst.Lazy.signature_item list -> t -> tval open_signature :
used_slot:bool ref ->
loc:Ocaml_parsing.Location.t ->
toplevel:bool ->
Ocaml_parsing.Asttypes.override_flag ->
Ocaml_parsing.Longident.t Ocaml_parsing.Location.loc ->
t ->
Path.t * mode_with_locks * tval open_pers_signature : string -> t -> Path.t * mode_with_locks * tval enter_value :
?check:(string -> Ocaml_utils.Warnings.t) ->
mode:(Mode.allowed * 'r) Mode.Value.t ->
string ->
Types.value_description ->
t ->
Ident.t * tval enter_type :
scope:int ->
string ->
Types.type_declaration ->
t ->
Ident.t * tval enter_extension :
scope:int ->
rebind:bool ->
string ->
Types.extension_constructor ->
t ->
Ident.t * tval enter_module :
scope:int ->
?arg:bool ->
string ->
Types.module_presence ->
Types.module_type ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
t ->
Ident.t * tval enter_module_declaration :
scope:int ->
?arg:bool ->
?shape:Shape.t ->
string ->
Types.module_presence ->
Types.module_declaration ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
?locks:locks ->
t ->
Ident.t * tval enter_modtype :
scope:int ->
string ->
Types.modtype_declaration ->
t ->
Ident.t * tval enter_class :
scope:int ->
string ->
Types.class_declaration ->
t ->
Ident.t * tval enter_cltype :
scope:int ->
string ->
Types.class_type_declaration ->
t ->
Ident.t * tval enter_signature :
?mod_shape:Shape.t ->
scope:int ->
Types.signature ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
t ->
Types.signature * tval enter_signature_and_shape :
scope:int ->
parent_shape:Shape.Map.t ->
Shape.t ->
Types.signature ->
?mode:(Mode.allowed * 'r) Mode.Value.t ->
t ->
Types.signature * Shape.Map.t * tval enter_unbound_value : string -> value_unbound_reason -> t -> tval enter_unbound_module : string -> module_unbound_reason -> t -> tval add_closure_lock :
Ocaml_typing.Mode.Hint.pinpoint ->
('l * Mode.allowed) Mode.Value.Comonadic.t ->
t ->
tval add_const_closure_lock :
?ghost:bool ->
Ocaml_typing.Mode.Hint.pinpoint ->
Mode.Value.Comonadic.Const.t ->
t ->
tA variant of add_closure_lock where the mode of the closure is a constant due to the nature of the pinpoint. As a result, the mode is not printed in error messages. ghost = true means the closure is not a value (such as a loop)
val enter_splice : loc:Ocaml_parsing.Location.t -> t -> tval check_no_open_quotations :
Ocaml_parsing.Location.t ->
t ->
no_open_quotations_context ->
unitval set_unit_name : Unit_info.t option -> unitval get_unit_name : unit -> Unit_info.t optionval read_signature :
Global_module.Name.t ->
Unit_info.Artifact.t ->
Types.signatureval save_signature :
alerts:Merlin_utils.Misc.alerts ->
Types.signature ->
Compilation_unit.Name.t ->
Cmi_format.kind ->
Unit_info.Artifact.t ->
Cmi_format.cmi_infos_lazyval save_signature_with_imports :
alerts:Merlin_utils.Misc.alerts ->
Types.signature ->
Compilation_unit.Name.t ->
Cmi_format.kind ->
Unit_info.Artifact.t ->
Import_info.t array ->
Cmi_format.cmi_infos_lazyval register_parameter : Global_module.Parameter_name.t -> unitval crc_of_unit : Compilation_unit.Name.t -> Digest.tval imports : unit -> Import_info.t listval import_crcs : source:string -> Import_info.t array -> unitval require_global_for_quote : Compilation_unit.Name.t -> unitval quoted_globals : unit -> Compilation_unit.Name.t listval runtime_parameter_bindings : unit -> (Global_module.t * Ident.t) listval is_bound_to_runtime_parameter : Ident.t -> boolval parameters : unit -> Global_module.Parameter_name.t listval is_imported_opaque : Compilation_unit.Name.t -> boolval register_import_as_opaque : Compilation_unit.Name.t -> unitval is_parameter_unit : Global_module.Name.t -> boolval implemented_parameter :
Global_module.Name.t ->
Global_module.Parameter_name.t optionval is_imported_parameter : Global_module.Name.t -> boolval short_paths : t -> Short_paths.ttype error = | Missing_module of Ocaml_parsing.Location.t * Path.t * Path.t| Illegal_value_name of Ocaml_parsing.Location.t * string| Lookup_error of Ocaml_parsing.Location.t * t * lookup_error| Incomplete_instantiation of {unset_param : Global_module.Parameter_name.t;}| Toplevel_splice of Ocaml_parsing.Location.t| Unsupported_inside_quotation of Ocaml_parsing.Location.t
* no_open_quotations_contextexception Error of errorval report_error : level:int -> Format.formatter -> error -> unitval report_lookup_error :
level:int ->
Ocaml_parsing.Location.t ->
t ->
Format.formatter ->
lookup_error ->
unitval is_in_signature : t -> boolval set_value_used_callback :
Subst.Lazy.value_description ->
(unit -> unit) ->
unitval set_value_mutated_callback :
Subst.Lazy.value_description ->
(unit -> unit) ->
unitval set_type_used_callback :
Types.type_declaration ->
((unit -> unit) -> unit) ->
unitval 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)
refval check_well_formed_module :
(t -> Ocaml_parsing.Location.t -> string -> Types.module_type -> unit) refval add_delayed_check_forward : ((unit -> unit) -> unit) refval scrape_alias : (t -> Subst.Lazy.module_type -> Subst.Lazy.module_type) refval same_constr : (t -> Types.type_expr -> Types.type_expr -> bool) refval constrain_type_jkind :
(t ->
Types.type_expr ->
Types.jkind_r ->
(unit, Jkind.Violation.t) result)
refval print_longident :
(Format.formatter -> Ocaml_parsing.Longident.t -> unit) refval print_path : (Format.formatter -> Path.t -> unit) refval print_type_expr : (Format.formatter -> Types.type_expr -> unit) refFolds
Folding over all identifiers (for analysis purpose)
val fold_values :
(string ->
Path.t ->
Subst.Lazy.value_description ->
Mode.Value.l ->
'a ->
'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_types :
(string -> Path.t -> Types.type_declaration -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_constructors :
(Types.constructor_description -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_labels :
'rcd Types.record_form ->
('rcd Types.gen_label_description -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_modules :
(string -> Path.t -> Subst.Lazy.module_declaration -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aPersistent structures are only traversed if they are already loaded.
val fold_modtypes :
(string -> Path.t -> Subst.Lazy.modtype_declaration -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_classes :
(string -> Path.t -> Types.class_declaration -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval fold_cltypes :
(string -> Path.t -> Types.class_type_declaration -> 'a -> 'a) ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval check_value_name : string -> Ocaml_parsing.Location.t -> unitUtilities
val print_address : Format.formatter -> address -> unitval address_head : address -> address_headval print_stage : Format.formatter -> stage -> unitval unbound_class : Path.tmerlin: manage internal state
val add_merlin_extension_module : Ident.t -> Types.module_type -> t -> tval scrape_lazy : (t -> Subst.Lazy.module_type -> Subst.Lazy.module_type) refval msupport_raise_error : (?ignore_unify:bool -> exn -> unit) refThis value should be filled in with Msupport.raise_error. Env cannot use this function directly because Msupport depends on Env
type 'acc fold_all_labels_f = {fold_all_labels_f : 'rcd. 'rcd Types.record_form ->
'rcd Types.gen_label_description ->
'acc ->
'acc;}val fold_all_labels :
'a fold_all_labels_f ->
Ocaml_parsing.Longident.t option ->
t ->
'a ->
'aval print_with_quote_promote :
Format.formatter ->
(string * stage * stage) ->
unit