package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

Dune Dependency

Authors

Maintainers

Sources

merlin-5.5-503.tbz
sha256=67da3b34f2fea07678267309f61da4a2c6f08298de0dc59655b8d30fd8269af1
sha512=1fb3b5180d36aa82b82a319e15b743b802b6888f0dc67645baafdb4e18dfc23a7b90064ec9bc42f7424061cf8cde7f8839178d8a8537bf4596759f3ff4891873

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.

OCaml

Innovation. Community. Security.