Module Merlin_analysis.Stack_or_heap_enclosingSource
Provides information about where allocations around the cursor are placed (the stack or the heap).
The information comes only from the Mode.Alloc.t contained in enclosing AST nodes.
- Nodes that never themselves allocate (like
Texp_let _expressions) are skipped - Nodes that might allocate and were assigned an allocation mode during typechecking return that mode in
Alloc_mode _ - Nodes that have a
Mode.Alloc.t optionfield that isNonebecause the corresponding expression doesn't allocate for a known reason (for example, aTexp_recordcorresponding to an unboxed record) return that reason inNo_alloc _ - Nodes that have a
Mode.Alloc.t optionfield that isNonewithout a known reason (usually because they didn't typecheck) returnUnexpected_no_alloc
Source
type stack_or_heap = | Alloc_mode of Ocaml_typing.Mode.Alloc.r| No_alloc of {}| Unexpected_no_alloc
Source
val from_nodes :
lsp_compat:bool ->
pos:Lexing.position ->
path:
(Ocaml_typing.Env.t
* Merlin_specific.Browse_raw.node
* Query_protocol.is_tail_position)
list ->
stack_or_heap_enclosings