package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.7.1-504.tbz
sha256=139b073cf914b38b725c54f75b8b642f654c3498d0a4ba8cfa831ff02a8970d5
sha512=9391d3a0aaa5065a02c6f5faaf7149f8f800c748d9be5ccff6af800ce73bdf418ead72dbeaf6ee7a6cbeae2c8e56285fbe422740ed407bcc4edab889dd1c8f9c

doc/merlin-lib.analysis/Merlin_analysis/Misc_utils/Path/index.html

Module Misc_utils.PathSource

Sourceval to_shortest_lid : env:Ocaml_typing.Env.t -> ?name:string -> env_check:(Ocaml_parsing.Longident.t -> Ocaml_typing.Env.t -> 'a) -> Ocaml_typing.Path.t -> Ocaml_parsing.Longident.t

to_shortest_lid ~env ~env_check path will make a Longident.t from the provided Path.t and attempt to use the shortest prefix possible given the currently opened modules. The result is checked by looking it up in the environment using the env_check : Longident.t -> Env.t -> 'a function.

The check is needed because shadowing can cause subtle issues. A typical check function would be Env.find_constructor_by_name. WHen the check fails the function will return Untypeast.lident_of_path path instead of clever prefix-less constructions.

Optionally a name can be provided that will be used as the last ident of the path.