Skip to content

expand macro recursively does nothing for ignored procmacros #14233

@tfreiberg-fastly

Description

@tfreiberg-fastly

If I improve goToReferences on function arguments by ignoring the tracing-attributes::instrument proc macro (as recommended in #12050), rust-analyzer won't expand that macro for me again.
The expansion buffer just shows the same function without the proc-macro attribute.

e.g.

#[tracing::instrument]
fn instrumented(s: String) {
    println!("Use s here: {}", s);
}

With the proc-macro ignored, goToReferences on s works, but the expanded buffer contains the following:

// Recursive expansion of instrument! macro
// =========================================

fn instrumented(s: String) {
    println!("Use s here: {}", s);
}

rust-analyzer version: rust-analyzer version: 0.3.1418-standalone (4e29820 2023-02-26)

rustc version: rustc 1.66.1 (90743e729 2023-01-10)

relevant settings:

    "rust-analyzer.procMacro.ignored": {
        "tracing-attributes": [
             "instrument"
        ]
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macromacro expansionC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions