-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
rust-analyzer version: rust-analyzer version: 0.3.1885-standalone (b6d1887 2024-03-17)
rustc version: rustc 1.75.0 (82e1608df 2023-12-21)
IDE: VSCode
NOT A CONTRIBUTION
Code
// println!($a, $b) ==>> eprintln!($a, $b)
fn main() {
println!("foo: {}", 123);
}
Steps to reproduce
cargo new foo
- Open new project with IDE and paste the code snippet to
src/main.rs
- Run code action for commented line with an SSR request
Expected behavior
The println!(…)
should become an eprintln!(…)
Observed behavior
Nothing happens
Additional context
If I trace the language server, it responds to the SSR request saying that there are no document changes. No errors are printed anywhere.
If I use a different replacement pattern, such as ($a, $b)
, it works just fine, so it's handling the match, it only fails on the replacement.
If I use a code snippet where I'm replacing a non-macro with a macro, that also fails:
fn foo(s: &str, x: isize) {}
// foo($a, $b) ==>> println!($a, $b)
fn main() {
foo("foo: {}", 123);
}