Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Add support for destruct #97

Open
Open
@Khady

Description

@Khady

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions