Skip to content

expand macro recursively does nothing for ignored procmacros #14233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tfreiberg-fastly opened this issue Mar 2, 2023 · 2 comments
Open

expand macro recursively does nothing for ignored procmacros #14233

tfreiberg-fastly opened this issue Mar 2, 2023 · 2 comments
Labels
A-macro macro expansion C-feature Category: feature request

Comments

@tfreiberg-fastly
Copy link

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"
        ]
    },
@tfreiberg-fastly tfreiberg-fastly added the C-bug Category: bug label Mar 2, 2023
@lnicola
Copy link
Member

lnicola commented Mar 2, 2023

That's what the setting does. It tells RA you don't want it to expand that macro.

@tfreiberg-fastly
Copy link
Author

Yeah that's what I expected, but in my mind as a user, telling RA to ignore a macro during code analysis does not necessarily mean that I don't want it to help me view what the macro expansion looks like
I absolute don't need this changed, I just wanted to bring it up :)

@lnicola lnicola added A-macro macro expansion C-feature Category: feature request and removed C-bug Category: bug labels Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants