Skip to content
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

Ability to disable the new "proc-macro is explicitly disabled" hint specifically #18414

Closed
paul-hansen opened this issue Oct 25, 2024 · 5 comments · Fixed by #18418
Closed

Ability to disable the new "proc-macro is explicitly disabled" hint specifically #18414

paul-hansen opened this issue Oct 25, 2024 · 5 comments · Fixed by #18418
Labels
A-proc-macro proc macro C-feature Category: feature request

Comments

@paul-hansen
Copy link

I just updated to the latest RA version and am now getting these hints:

macro-error: ::leptos::leptos_dom::tracing::instrument: proc-macro is explicitly disabled
macro-error: tracing::instrument: proc-macro is explicitly disabled
macro-error: server: proc-macro is explicitly disabled

Which is because I told it not to expand instrument and server macros. Since they just wrap the code, this allows RA to treat them as no-op and it helps with completion inside them, performance etc.

I'm fine with this hint existing, but I personally don't want it because it I use this in a lot of places and it creates a lot of noise. Unfortunately the only way I've found to disable it is to disable the macro-error diagnostic which seems overly broad and I'm afraid I'll miss other important macro errors.

There should probably be a way to disable that hint specifically. I'm open to other solutions too though, e.g. if there's a way to disable just hints for macro-error.

@paul-hansen paul-hansen added the C-feature Category: feature request label Oct 25, 2024
@lnicola lnicola added A-diagnostics diagnostics / error reporting A-proc-macro proc macro and removed A-diagnostics diagnostics / error reporting labels Oct 26, 2024
@futile
Copy link

futile commented Jan 8, 2025

Cross-posting my comment in the PR:

Hi, just saw this PR, awesome work, thank you! Any idea why I get a diagnostic with "proc-macro is explicitly disabled" but kind macro-error, on version rust-analyzer 1.83.0 (90b35a62 2024-11-26)?

If I add macro-error to my disabled diagnostics, it goes away. But adding proc-macro-disabled instead still shows the diagnostic.

Any help would be appreciated, thanks! :)

@Veykril
Copy link
Member

Veykril commented Jan 9, 2025

The kind seems to be proc-macros-disabled and proc-macro-disabled, there seems to be a mismatch between docs and reality (both work, but they hide different diagnostics, the one you want is the latter), #18890 makes this a bit clearer

@futile
Copy link

futile commented Jan 9, 2025

Thank you! proc-macro-disabled (the latter) is the one I tried, but it didn't work.

The diagnostic is also labeled as macro-error in my editor:

Image

This is with version rust-analyzer 1.83.0 (90b35a62 2024-11-26), but since the MR that split up the diagnostic kind was merged ~one month before this date, I thought it should already be in this version.

@Veykril
Copy link
Member

Veykril commented Jan 9, 2025

Oh you are using the rustup component, no in that case the PR is not in there yet. The rustup version lags 6-12 weeks behind master

@futile
Copy link

futile commented Jan 9, 2025

Ohh got it, thanks a lot! Then it should be fixed with 1.84 I hope, got it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macro proc macro C-feature Category: feature request
Projects
None yet
4 participants