Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Cannot complete macro path in macro <!-- Troubleshooting guide:…

  1. 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:

    macro_rules! bar { () => (); }
    macro_rules! foo { ($i:ident) => { $i!() }; }
    fn main() {
        foo!(bar$0);
    }
    

    Interface

    No new interfaces are introduced.

  2. Assistant

    I’ll trace macro-call completion handling, add a focused regression test for this fixture, then implement and run the narrow test suite.

  3. Assistant

    rg is unavailable in this checkout, so I’m switching to targeted find/grep searches and keeping the investigation scoped to completion and macro-expansion crates.

  4. Assistant

    The failure is at the second expansion layer: $i becomes the path of bar!(), and the speculative completion marker changes that path to barcomplete_me!(). The code currently treats the differing macro paths as an inconsistent expansion and discards completion. I’m changing that case to stop expansion at the macro path—where normal path completion can resolve bar—while retaining the inconsistency guard for unrelated differences.

  5. Assistant

    The regression still reproduces, so the path-mismatch branch is not the first failure point. I’m narrowing this through the token-tree selection logic; the likely issue is that completion in a call’s path has no enclosing argument token tree, causing expansion to abort before the path comparison.

  6. Assistant

    The completion now reaches the correct expanded layer and offers bar as a macro-path replacement (without adding another !, since the invocation already contains one). I’ve aligned the snapshot with the normal expression-scope candidates and am running the full ide-completion crate tests to catch regressions.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.