Module Merlin_analysis.DestructSource

Destruct at the moment works in two contexts:

  match e with
  | p1 -> _
  | ...

This matching will be exhaustive.

If e has a "package" type, it will be replaced by let module M = (val e) in _

  1. if your matching is not exhaustive, it will be made exhaustive.
  2. if your matching is exhaustive, it will refine the subpattern under the cursor if possible (i.e. if your cursor is on a variable or _ ).

* * *

Final remarks:

Sourceexception Not_allowed of string
Sourceexception Useless_refine
Sourceexception Nothing_to_do
Sourceexception Ill_typed
Sourceexception Wrong_parent of string

node ~env parents current_node returns a location indicating which portion of the buffer must be replaced and the string to replace it with.