Module Merlin_kernel.Mtyper
Result of typechecker
Mtyper essentially produces a typedtree, but to make sense of it the OCaml typechecker need to be in a specific state.
The result type wraps a snapshot of this state with the typedtree to ensure correct accesses.
type typedtree = [ | `Interface of Ocaml_typing.Typedtree.signature| `Implementation of Ocaml_typing.Typedtree.structure
]type index =
Ocaml_parsing.Longident.t Ocaml_parsing.Location.loc list
Ocaml_typing.Shape.Uid.Map.tval set_index_items :
(Merlin_kernel.Mtyper.index ->
Merlin_kernel.Mconfig.t ->
[ `Impl of Ocaml_typing.Typedtree.structure_item list
| `Intf of Ocaml_typing.Typedtree.signature_item list ] ->
Merlin_kernel.Mtyper.index) ->
unitval get_env :
?pos:Merlin_kernel.Msource.position ->
Merlin_kernel.Mtyper.result ->
Ocaml_typing.Env.tval get_typedtree :
Merlin_kernel.Mtyper.result ->
Merlin_kernel.Mtyper.typedtreeval get_index : Merlin_kernel.Mtyper.result -> Merlin_kernel.Mtyper.indexval get_stamp : Merlin_kernel.Mtyper.result -> intval get_errors : Merlin_kernel.Mtyper.result -> exn listval initial_env : Merlin_kernel.Mtyper.result -> Ocaml_typing.Env.tval get_cache_stat :
Merlin_kernel.Mtyper.result ->
Merlin_kernel.Mtyper.typer_cache_statsval node_at :
?skip_recovered:bool ->
?let_pun_behavior:Merlin_kernel.Mbrowse.Let_pun_behavior.t ->
Merlin_kernel.Mtyper.result ->
Stdlib.Lexing.position ->
Merlin_kernel.Mbrowse.tHeuristic to find suitable environment to complete / type at given position. * 1. Try to find environment near given cursor. * 2. Check if there is an invalid construct between found env and cursor : * Case a. * > let x = valid_expr || * The env found is the right most env from valid_expr, it's a correct * answer. * Case b. * > let x = valid_expr * > let y = invalid_construction|| * In this case, the env found is the same as in case a, however it is * preferable to use env from enclosing module rather than an env from * inside x definition.