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

Rename symbol does not rename variables in println statements #16470

Closed
1 task done
aldreth opened this issue Aug 19, 2024 · 2 comments
Closed
1 task done

Rename symbol does not rename variables in println statements #16470

aldreth opened this issue Aug 19, 2024 · 2 comments
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers rust Rust programming language support

Comments

@aldreth
Copy link

aldreth commented Aug 19, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Using the Rename Symbol action in rust code does not update the variable name in println statements (it does update them in print statements)

eg some_var in println!("{some_var}") does not get updated when changing the variable name:

fn main() {
    let some_var = "a";
    let _ = some_var;
    println!("{some_var}")
}

Environment

Zed: v0.148.1 (Zed)
OS: macOS 14.5.0
Memory: 32 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
@aldreth aldreth added admin read bug [core label] labels Aug 19, 2024
@notpeter
Copy link
Member

notpeter commented Aug 20, 2024

Our behavior is identical to that of VSCode (renames some_var except when inside a macro like println!) so my assumption is that this is an upstream rust-analyzer issue. The original upstream issue rust-lang/rust-analyzer#11296 was closed 2023-12-05 via rust-lang/rust-analyzer#16027. I'm not sure whether this was a recent regression or whether this has never worked.

@notpeter notpeter added rust Rust programming language support language server failure Language server doesn't work as expected language server An umbrella label for all language servers and removed triage labels Aug 20, 2024
@aldreth
Copy link
Author

aldreth commented Aug 28, 2024

This is now fixed - rust analyser updated from 0.3.2078-standalone (fa0032624 2024-08-17) to 0.3.2089-standalone (0f7f68dad 2024-08-27) and I assume that fixed it.

@aldreth aldreth closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers rust Rust programming language support
Projects
None yet
Development

No branches or pull requests

2 participants