package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.9.tbz
sha256=de395dd37d246e3ec303e1af35ff8421665fa4f0f0005d95732124b22e3417ac
sha512=74756b28767cdfe10288720540582e818a9d946dd2406606724ebc7b68d1cf6623142e56a1e457f7862839732e7add365aec056930c7ac89be7036c22e5f29ae

doc/merlin-lib.analysis/Merlin_analysis/Enclosing/index.html

Module Merlin_analysis.EnclosingSource

This module contains the "enclosing" implementation.

The enclosing of a range, is the set of parent ranges that would be logical to expand to. In LSP, it is called "selection range".

Contrary to "type enclosings", which need to be typable nodes from the parsetree, "enclosings" are not necessarily nodes: They can split the inclusion of a node in multiple ranges. For instance, with square brackets denoting ranges, we want to include a range for each let ... in:

[[[[let x1 = 1 in]
    let x2 = 1 in]
    let x3 = 1 in]
    x1 + x2 + x3]

Note that the implementation would be strengthened by using a non-ppxed version of Mbrowser.t.

Generate the list of ranges from:

  • A range as "starting point",
  • A list of parents for the current node