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

Question: How to get Warnings for Unused usings? #4062

Closed
FloatingSunfish opened this issue Sep 13, 2020 · 2 comments
Closed

Question: How to get Warnings for Unused usings? #4062

FloatingSunfish opened this issue Sep 13, 2020 · 2 comments

Comments

@FloatingSunfish
Copy link

I saw this issue where previously, unused usings were being presented as warnings.
The solution was to no longer show them as warnings and instead fade the unused usings.

However, I like getting warnings for unused usings as I want to remove all of them from my project.

Is there an option to make OmniSharp flag them as warnings so I can see them?

Note: I have also seen this feature request to remove unused usings, but because it has not yet been implemented, I would like to know how to get warnings about them in the meantime.

@JoeRobich
Copy link
Member

Set omnisharp.enableRoslynAnalyzers = true and omnisharp.enableEditorConfigSupport = true in settings, then in your .editorconfig you can set the severity as you like.

root = true

[*.cs]

# IDE0005: Using directive is unnecessary
dotnet_diagnostic.IDE0005.severity = warning

@FloatingSunfish
Copy link
Author

Noted, @JoeRobich! Thanks! :)

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

2 participants