Merlin_specific.Browse_raw
SourceBrowse_node
offers a uniform interface to traverse constructions from * TypedTree
. * * Mutually recursive types from TypedTree
are wrapped into different * constructors of the type node
. * Then the fold
function traverses one-level of sub-nodes. * * In the meantime, the most specific environment and location are threaded * (FIXME: should these two be managed separately?). * * Finally BrowseT
module a node into a tree which structure mimics * the recursive structure of the TypedTree
node. *
type node =
| Dummy
| Pattern : _ Ocaml_typing.Typedtree.general_pattern -> node
| Expression of Ocaml_typing.Typedtree.expression
| Case : _ Ocaml_typing.Typedtree.case -> node
| Class_expr of Ocaml_typing.Typedtree.class_expr
| Class_structure of Ocaml_typing.Typedtree.class_structure
| Class_field of Ocaml_typing.Typedtree.class_field
| Class_field_kind of Ocaml_typing.Typedtree.class_field_kind
| Module_expr of Ocaml_typing.Typedtree.module_expr
| Module_type_constraint of Ocaml_typing.Typedtree.module_type_constraint
| Structure of Ocaml_typing.Typedtree.structure
| Signature of Ocaml_typing.Typedtree.signature
| Structure_item of Ocaml_typing.Typedtree.structure_item * Ocaml_typing.Env.t
| Signature_item of Ocaml_typing.Typedtree.signature_item * Ocaml_typing.Env.t
| Module_binding of Ocaml_typing.Typedtree.module_binding
| Value_binding of Ocaml_typing.Typedtree.value_binding
| Module_type of Ocaml_typing.Typedtree.module_type
| Module_declaration of Ocaml_typing.Typedtree.module_declaration
| Module_type_declaration of Ocaml_typing.Typedtree.module_type_declaration
| With_constraint of Ocaml_typing.Typedtree.with_constraint
| Core_type of Ocaml_typing.Typedtree.core_type
| Package_type of Ocaml_typing.Typedtree.package_type
| Row_field of Ocaml_typing.Typedtree.row_field
| Value_description of Ocaml_typing.Typedtree.value_description
| Type_declaration of Ocaml_typing.Typedtree.type_declaration
| Type_kind of Ocaml_typing.Typedtree.type_kind
| Type_extension of Ocaml_typing.Typedtree.type_extension
| Extension_constructor of Ocaml_typing.Typedtree.extension_constructor
| Label_declaration of Ocaml_typing.Typedtree.label_declaration
| Constructor_declaration of Ocaml_typing.Typedtree.constructor_declaration
| Class_type of Ocaml_typing.Typedtree.class_type
| Class_signature of Ocaml_typing.Typedtree.class_signature
| Class_type_field of Ocaml_typing.Typedtree.class_type_field
| Class_declaration of Ocaml_typing.Typedtree.class_declaration
| Class_description of Ocaml_typing.Typedtree.class_description
| Class_type_declaration of Ocaml_typing.Typedtree.class_type_declaration
| Binding_op of Ocaml_typing.Typedtree.binding_op
| Include_description of Ocaml_typing.Typedtree.include_description
| Include_declaration of Ocaml_typing.Typedtree.include_declaration
| Open_description of Ocaml_typing.Typedtree.open_description
| Open_declaration of Ocaml_typing.Typedtree.open_declaration
| Method_call of Ocaml_typing.Typedtree.expression
* Ocaml_typing.Typedtree.meth
* Ocaml_parsing.Location.t
| Record_field of [ `Expression of Ocaml_typing.Typedtree.expression
| `Pattern of Ocaml_typing.Typedtree.pattern ]
* Ocaml_typing.Types.label_description
* Ocaml_parsing.Longident.t Ocaml_parsing.Location.loc
| Module_binding_name of Ocaml_typing.Typedtree.module_binding
| Module_declaration_name of Ocaml_typing.Typedtree.module_declaration
| Module_type_declaration_name of Ocaml_typing.Typedtree.module_type_declaration
val fold_node :
(Ocaml_typing.Env.t -> node -> 'a -> 'a) ->
Ocaml_typing.Env.t ->
node ->
'a ->
'a
Accessors for information specific to a node
val node_paths_and_longident :
node ->
(Ocaml_typing.Path.t Ocaml_parsing.Location.loc * Ocaml_parsing.Longident.t)
list
val node_is_constructor :
node ->
[ `Description of Ocaml_typing.Types.constructor_description
| `Declaration of Ocaml_typing.Typedtree.constructor_declaration
| `Extension_constructor of Ocaml_typing.Typedtree.extension_constructor ]
Ocaml_parsing.Location.loc
option
val all_holes :
(Ocaml_typing.Env.t * node) ->
(Ocaml_parsing.Location.t
* Ocaml_typing.Env.t
* [ `Exp of Ocaml_typing.Types.type_expr
| `Mod of Ocaml_typing.Types.module_type ])
list