Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #86
ghost opened this issue Jan 15, 2022 · 1 comment · Fixed by #16027
Closed
Tracked by #86

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

ghost opened this issue Jan 15, 2022 · 1 comment · Fixed by #16027
Labels
A-ide general IDE features C-feature Category: feature request

Comments

@ghost
Copy link

ghost commented Jan 15, 2022

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.

@bjorn3
Copy link
Member

bjorn3 commented Jan 15, 2022

Format_args_capture is not yet supported. See #11260.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants