Skip to content

Renaming a captured variable in a formatted string doesn't work #11296

Closed
@ghost

Description

rust-analyzer version: 844c152 2022-01-15 nightly

rustc version: rustc 1.58.0 (Arch Linux rust 1:1.58.0-1)

Issue:

Given the following code snippet:

let world = "World";
println!("Hello {world}");

I can't rename the world variable in the formatted string. When I try to use Rename Symbol in VSCode on it, it gives the message: "No references found at this position".

When I rename the world variable in the first line, it only renames it there and doesn't update the one in the print statement.

Also, I noticed that Go To Declaration on world in the print statement doesn't do anything.

This may just be a case where Rust Analyzer needs to be updated to support the new 1.58 feature for captured arguments, but I still wanted to put this out there.

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions