Skip to content

Improve completion of macro_rules partial inputs #20623

@A4-Tacks

Description

@A4-Tacks

rust-analyzer version: rust-analyzer 1.91.0-nightly (040a98a 2025-08-20)

rustc version: rustc 1.91.0-nightly (040a98af7 2025-08-20)

editor or extension: coc-rust-analyzer

code snippet to reproduce:

macro_rules! vec_like {
    ($($e:expr),+ $(,)?) => {
        [$($e),+]
    };
}

fn main() {
    vec_like!("".|);
}

| is cursor

Unable to complete when entering the dot, as it cannot be fully parsed as expr

But there are no other matching branches at this point,
should we try inputting the incomplete expr into the macro_rules?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions