Skip to content

goto_definition should not navigate to the local variable defined in macros. #10535

Closed
@xffxff

Description

@xffxff

As @matklad mentions heregoto_definition should not navigate to the local variable defined in macros.

macro_rules! m {
    () => {
        let x = 2;
    };
}

#[test]
fn test_hygiene() {
    let x = 1;
    m!();
    println!("{}", x)
}

When I put the cursor on the x in println!, use goto_definition, it will navigate to macro call m!().
Similarly, highlight_related should not highlight m! when I put the cursor on the x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-hygieneA-macromacro expansionC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions