Skip to content

Introduce postfixes to turn expressions into variables (like IntelliJ's .var). #6426

@saiintbrisson

Description

@saiintbrisson

Create two new postfixes: let and letm.

let:

"Hello, World!".let
let $0 = "Hello, World!";

and letm

"Hello, World!".letm
let mut $0 = "Hello, World!";

If possible, creating variables for expressions being called would be awesome:

vec![1, 2, 3].into_iter().map(|foo| foo * 2);

calling .let after vec![1, 2, 3] would turn into:

let $0 = vec![1, 2, 3];
$0.into_iter().map(|foo| foo * 2);

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