rust-analyzer version: 0.4.2938-standalone (888f581 2026-06-15)
editor or extension: VSCode, extension version 0.4.2938
code snippet to reproduce:
macro_rules! foo {
($bar:tt) => {
const { $bar }
};
}
- Place the cursor immediately to the right of
const { on the third line.
- Press Enter (invoke
rust-analyzer.onEnter)
The result is:
macro_rules! foo {
($bar:tt) => {
const {
}
};
}
The tokens $bar have been deleted, but should not be. This appears to happen to any occurrences of the text $ followed by an identifier or number which are to the right of a {. Also, if it is the text $0, then an additional cursor appears there. This suggests that the problem is incorrect escaping of replacement text passed to VS Code.
rust-analyzer version: 0.4.2938-standalone (888f581 2026-06-15)
editor or extension: VSCode, extension version 0.4.2938
code snippet to reproduce:
const {on the third line.rust-analyzer.onEnter)The result is:
The tokens
$barhave been deleted, but should not be. This appears to happen to any occurrences of the text$followed by an identifier or number which are to the right of a{. Also, if it is the text$0, then an additional cursor appears there. This suggests that the problem is incorrect escaping of replacement text passed to VS Code.