Skip to content

Snippets: suggest names based on labels if they exist #1885

@cartermp

Description

@cartermp

If I define a type with labels, e.g.

type BST<'T> =
    | Empty
    | Node of value:'T * left:BST<'T> * right:BST<'T>

Then if I use that type with destructuring syntax and I need to assign names to things, I think that the IDE should suggest a name based on the label if it exists.

let rec flip t = 
    match t with
    | Empty -> t
    | Node(value, left, right) -> ...
//          ^^     ^^   ^^
//   These are each suggested to me by the IDE.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions