Skip to content

"Extract into variable" action not shown when selecting macro invocation #6866

@Nadrieril

Description

@Nadrieril

In the following, for some selections the "extract into variable" code action is not listed.

fn main() {
    let x = Some(1);
    let some_condition = false;
    let other_condition = matches!(x, None) || some_condition;
    //                    -----------------                   not listed
    //                   ------------------                   not listed
    //                    ------------------                  listed, but includes the whole expression
    //                    ----------------------------------- listed
    //                                         -------------- listed
}

This fails similarly for other macros (todo, println), with or without arguments.
As a sidenote I find it confusing that selecting a bit of whitespace around an expression ends up selecting more things than just the expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions