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

Some commonly-reported diagnostic results at suggestion level cannot be disabled #69829

Closed
KyouyamaKazusa0805 opened this issue Sep 6, 2023 · 6 comments
Assignees
Milestone

Comments

@KyouyamaKazusa0805
Copy link

KyouyamaKazusa0805 commented Sep 6, 2023

Version Used:

VS 17.8p1

Steps to Reproduce:

[SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>")]
private static void UnusedMethod(int unusedParameter)
{
}

Diagnostic Id:

Some diagnostic results at suggestion level (Maybe result IDs starting with IDE like IDE0060? I don't test for all diagnostic results, but some commonly-reported can be reproduced, e.g. IDE0051, IDE0060, IDE0011 and so on).

Expected Behavior:

If I use SuppressMessageAttribute and #pragma warning disable, the suggestions can be disabled and no longer be displayed.

Actual Behavior:

It is still displayed no matter how I disable them:

image

image

image

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Sep 6, 2023
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@huoyaoyuan
Copy link
Member

In what scope do you want to disable it? how about using globalconfig?

@KyouyamaKazusa0805
Copy link
Author

@huoyaoyuan I just want to disable it in this file...

@KyouyamaKazusa0805 KyouyamaKazusa0805 changed the title Some common-reported suggestions cannot be disabled Some commonly-reported suggestions cannot be disabled Sep 6, 2023
@KyouyamaKazusa0805 KyouyamaKazusa0805 changed the title Some commonly-reported suggestions cannot be disabled Some commonly-reported diagnostic results at suggestion level cannot be disabled Sep 6, 2023
@genlu genlu added Area-IDE Area-Analyzers and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 6, 2023
@genlu genlu added this to the 17.8 milestone Sep 6, 2023
@genlu
Copy link
Member

genlu commented Sep 6, 2023

@SunnieShine FYI you could disable this rule for a single file in editorconfig file, see this
@mavasani Any suggestions here?

@mavasani
Copy link
Contributor

mavasani commented Sep 7, 2023

This is a duplicate of https://developercommunity.visualstudio.com/t/SuppressMessage-attribute-is-being-ign/10439130.
It was fixed in VS2022 17.8 Preview2 with #69492
It was backported to VS2022 17.7 release with #69517

@mavasani mavasani closed this as completed Sep 7, 2023
@KyouyamaKazusa0805
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants