Merlin_analysis.Typedtree_utils
SourceUtilities 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 list
extract_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) list
let_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 pat_var_id_and_loc :
Ocaml_typing.Typedtree.pattern ->
(Ocaml_typing.Ident.t * string Ocaml_parsing.Location.loc) option
pat_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)
option
pat_alias_id_and_loc
try to extract the id
and the location
of pattern alias.