rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.85k stars 1.53k forks source link

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

Open kpreid opened 2 weeks ago

kpreid commented 2 weeks ago

rust-analyzer version: 0.4.2014-standalone (b33a0cae3 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

rustbot commented 2 weeks ago

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.

rustbot commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

@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-*".