Cannot complete macro path in macro <!-- Troubleshooting guide:…
- User
Cannot complete macro path in macro
rust-analyzer version: rust-analyzer 0.4.2897-standalone
rustc version: rustc 1.97.0-nightly (36ba2c771 2026-04-23)
editor or extension: Vim
code snippet to reproduce:
rustmacro_rules! bar { () => (); } macro_rules! foo { ($i:ident) => { $i!() }; } fn main() { foo!(bar$0); }Interface
No new interfaces are introduced.
- Assistant
I’ll trace macro-call path completion, add a focused regression test for this fixture, then run the narrow completion test suite and tidy checks relevant to the edit.
- Assistant
rgisn’t installed in this checkout, so I’m switching to targetedfind/grepsearches. The worktree is clean. - Assistant
The failure is in expansion stopping: the completed identifier becomes the path of a nested macro call (
bar!()), but completion currently treats every token under a macro-call syntax node as still being inside that call’s input. I’m adding a regression that distinguishes the call path from its token-tree arguments, then adjusting that boundary. - Assistant
The regression now reaches normal path analysis inside the expansion and includes both
barandfoomacro candidates (alongside ordinary expression-path candidates, matching existing completion behavior). I’m validating the fullide-completioncrate now, not just the new test.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.