Skip to content

[FR]: Show capturing environment on hover for async closure #21625

@stormshield-gt

Description

@stormshield-gt

Currently for async closure when hovering on || it always shows that's it captures nothing even if that is not the case.

Image

Ideally, it should be able to show what it's capturing, like for normal closure.

Image
Rust code
#[tokio::main]
async fn main() {
    let mut count = 0;
    let mut c = async || {
        count += 1;
    };
    c().await;
    dbg!(count);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions