Skip to content

Add a code action to replace _ with type #5447

@giacomocavalieri

Description

@giacomocavalieri

It would be nice if the LS allowed to replace a _ anywhere in a type annotation with the corresponding type. Many times I start by writing some incomplete type Result(_, _) and fill in the blanks later, right now to do that I'd delete the entire signature and have the LS generate it again.

So for example:

pub fn wibble() -> Result(List(_), Nil) {
//             trigger it here ^
  Ok([1, 2, 3])
}

produces:

pub fn wibble() -> Result(List(Int), Nil) {
  Ok([1, 2, 3])
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions