Module Merlin_analysis.Type_enclosingSource

Provides type information around the cursor.

The information comes from two sources: 1. enclosing AST nodes: we just retrieve the types in the typedtree 2. if the cursor is on an identifier, by typing it in the current environment

(2) is primarily useful in the following situations:

Furthermore, (2) has a finer granularity than (1): when the cursor is in the middle of a longident, e.g. Foo.B|ar.Baz.lol (with | being the cursor), then we'll have one AST node covering the whole ident. But what we reconstruct gives us: Foo.Bar, Foo.Bar.Baz, Foo.Bar.Baz.lol; and we return the type for each of them. These are what we call "small enclosings".

There are however some issues with the small enclosings:

Sourceval log_section : string