package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.8.1-505.tbz
sha256=b8fb32bc0fc092af2fd6bdc831cb966057f2e3fd7b99a172b705e96ba8082583
sha512=01ca96f8167d062ba24036e43f650ff958fb157d44867bd52eb7999b7d19bf9fc97cdcd46c04b6979f0e1149d5041047723eed5913b03c4404d7acb116183bee

doc/merlin-lib.kernel/Merlin_kernel/Mtyper/index.html

Module Merlin_kernel.MtyperSource

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.

Sourcetype result
Sourcetype typedtree = [
  1. | `Interface of Ocaml_typing.Typedtree.signature
  2. | `Implementation of Ocaml_typing.Typedtree.structure
]
Sourcetype typer_cache_stats =
  1. | Miss
  2. | Hit of {
    1. reused : int;
    2. typed : int;
    }
Sourceval set_index_items : (index -> Mconfig.t -> [ `Impl of Ocaml_typing.Typedtree.structure_item list | `Intf of Ocaml_typing.Typedtree.signature_item list ] -> index) -> unit
Sourceval get_typedtree : result -> typedtree
Sourceval get_index : result -> index
Sourceval get_stamp : result -> int
Sourceval get_errors : result -> exn list
Sourceval initial_env : result -> Ocaml_typing.Env.t
Sourceval get_cache_stat : result -> typer_cache_stats
Sourceval node_at : ?disambiguate:Mbrowse.Tie_breaker.t -> ?skip_recovered:bool -> result -> Lexing.position -> Mbrowse.t

Heuristic 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. * * disambiguate argument is used to select the node at cursor when multiple * nodes share the same location.