Module Merlin_analysis.Stack_or_heap_enclosing
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
type stack_or_heap_enclosings =
(Ocaml_parsing.Location.t
* Merlin_analysis.Stack_or_heap_enclosing.stack_or_heap)
listval from_nodes :
lsp_compat:bool ->
pos:Stdlib.Lexing.position ->
path:
(Ocaml_typing.Env.t
* Merlin_specific.Browse_raw.node
* Query_protocol.is_tail_position)
list ->
Merlin_analysis.Stack_or_heap_enclosing.stack_or_heap_enclosings