Open
Description
Merlin is able to destruct a value to create a pattern matching on it. It would be nice to support this feature
Example:
let () =
let a = Some 1 in
a<CURSOR>
After calling destruct becomes
let () =
let a = Some 1 in
(match a with | None -> (??) | Some _ -> (??))
From merlin documentation:
["case","analysis","from",position,"to",position]
Try to destruct patterns in the specified range. It returns a value with the shape [{"start": position, "end": position}, content]
. The editor is expected to replace content between start and end by content.
Activity