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

“Inline variable” assist doesn't adjust formatting macros #17499

Open
kpreid opened this issue Jun 26, 2024 · 4 comments
Open

“Inline variable” assist doesn't adjust formatting macros #17499

kpreid opened this issue Jun 26, 2024 · 4 comments
Labels
A-assists C-bug Category: bug

Comments

@kpreid
Copy link
Contributor

kpreid commented Jun 26, 2024

rust-analyzer version: 0.4.2014-standalone (b33a0ca 2024-06-26)

rustc version: rustc 1.81.0-nightly (bcf94dec5 2024-06-23)

editor or extension: VSCode

code snippet to reproduce:

fn foo() {
    let numerator = 1;
    let denominator = 64;
    println!("{numerator}/{denominator}");
}

Apply the “Inline variable” assist to numerator. The result is

fn foo() {
    let denominator = 64;
    println!("{numerator}/{denominator}");
}

which leaves numerator undefined. The result should instead be

fn foo() {
    let denominator = 64;
    println!("{numerator}/{denominator}", numerator = 1);
}

@rustbot label +A-assists

@kpreid kpreid added the C-bug Category: bug label Jun 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2024

Error: Label A-assists can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@kpreid kpreid changed the title “Inline variable” assist produces incorrect code in the presence of formatting macros “Inline variable” assist doesn't adjust formatting macros Jun 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2024

Error: Label A-assists can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@Veykril
Copy link
Member

Veykril commented Jun 26, 2024

Are those perms managed by the teams repo or do we just need to add something to our triagebot config to allow any rust project member to add those

@kpreid
Copy link
Contributor Author

kpreid commented Jun 26, 2024

@Veykril It didn't work because I'm not a project member at all. If you want that to succeed, then in triagebot.toml, the relabel.allow-unauthenticated list must contain "A-*".

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

No branches or pull requests

3 participants