Skip to content

Extract to function/variable unescapes '\\' #13558

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

Closed
RagnarGrootKoerkamp opened this issue Nov 6, 2022 · 1 comment
Closed

Extract to function/variable unescapes '\\' #13558

RagnarGrootKoerkamp opened this issue Nov 6, 2022 · 1 comment
Labels
A-assists C-bug Category: bug

Comments

@RagnarGrootKoerkamp
Copy link

RagnarGrootKoerkamp commented Nov 6, 2022

This is similar to #11897, but for extracting to function/variable instead of snippet completion.

rust-analyzer version: rust-analyzer 1 (ba28e19 2022-10-29)

rustc version: rustc 1.62.0-nightly (30f386087 2022-05-05)

relevant settings: None, I think

Example:

fn main(){
    let a = "\\ $0";
}

selecting the enther let a line and doing extract to variable results in

fn main(){
    let var_name = &"\ ";
    let a = var_name;
}

I.e., both the \\ and the $0 are replaced wrongly.

@lnicola
Copy link
Member

lnicola commented Feb 12, 2024

Fixed in #16467

@lnicola lnicola closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants