Merlin_analysis.Typedtree_utilsSourceUtilities to keep explicit Typedtree manipulations local to Merlin_lib for alternative clients like ocaml-lsp.
val extract_toplevel_identifier :
Ocaml_typing.Typedtree.signature_item ->
Ocaml_typing.Ident.t listextract_toplevel_identifier sigitem extracts toplevel identifier of a signature item. It returns a list for dealing with recursive elements.
val let_bound_vars :
Ocaml_typing.Typedtree.value_binding list ->
(Ocaml_typing.Ident.t * string Ocaml_parsing.Location.loc) listlet_bound_vars binding_list extract the Ident.t and the location of variables bind in the form of let b = e ... in a list of bindings.
val location_of_declaration :
uid:Ocaml_typing.Shape.Uid.t ->
Ocaml_typing.Typedtree.item_declaration ->
string Ocaml_parsing.Location.loc optionExtracts the location of a uid from a Typedtree.item_declaration
val pat_var_id_and_loc :
Ocaml_typing.Typedtree.pattern ->
(Ocaml_typing.Ident.t * string Ocaml_parsing.Location.loc) optionpat_var_id_and_loc try to extract the id and the location of pattern variable.
val pat_alias_pat_id_and_loc :
Ocaml_typing.Typedtree.pattern ->
(Ocaml_typing.Typedtree.pattern
* Ocaml_typing.Ident.t
* string Ocaml_parsing.Location.loc)
optionpat_alias_id_and_loc try to extract the id and the location of pattern alias.