rust-analyzer
rust-analyzer copied to clipboard
No autocompletion for consts inside format strings.
Code sample:
fn main() {
let variable1 = 1;
let variable2 = 2;
const CONSTANT = 3;
println!("Some format string {}");
}
Current behavior:
https://github.com/rust-lang/rust-analyzer/assets/69449791/5b2944d2-6308-403e-b11c-3f6f2520988e
When applied to format strings, only variables, not constant, will be included in the autocompletion list. Is this by design or is it a bug?
That's a bug, we are only handling locals here https://github.com/rust-lang/rust-analyzer/blob/2223b4fa71e543ac6dd1abd4770a69fab8dbdec1/crates/ide-completion/src/completions/format_string.rs#L33-L36
@rustbot claim