rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

“Inline variable” assist doesn't adjust formatting macros

Open kpreid opened this issue 1 year ago • 4 comments

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

kpreid avatar Jun 26 '24 16:06 kpreid

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 avatar Jun 26 '24 16:06 rustbot

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 avatar Jun 26 '24 16:06 rustbot

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

Veykril avatar Jun 26 '24 19:06 Veykril

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

kpreid avatar Jun 26 '24 20:06 kpreid