-
Notifications
You must be signed in to change notification settings - Fork 678
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
VS Code extension: Do not warn about unused using
s
#315
Comments
Indeed, it seems that surfacing these rather minor issues as |
Is there any way to control what things are considered warnings or errors? |
Any solution for this? |
I would also like to know how to disable this specific warning. |
Hi everyone! In the 1.7 release (due out soon), you should be able to do the following.
Hopefully that will address this for everyone here. |
Ugh. Is this actually a useful warning though? It's so completely harmless to have extra using's. It also means that every default ASP.NET Core project will have several dozen of these warnings because default projects always include "a few extra" namespaces because you'll almost certainly need them. E.g. every new CS file typically includes |
It's only a warning because VS Code doesn't have the ability to declare a diagnostic that is "hidden" that has a different presentation (such as fading the code). |
I'm not sure it's better to have dozens of unimportant warnings than to have nothing at all. If VS Code later adds support for faded code like VS then it's fine. But in the meantime this seems like aggressive behavior for a code editor. I know at least for me, when I see a |
Ohhh, that's not as bad then. I think I'd still find it a little annoying, especially if there are ~20 - 30 in a default project. But it's not obnoxious. Thanks! |
It is annoying. Agreed 100%. 😄 I (finally) filed an official request on VS Code for faded code: microsoft/vscode#20219. |
Thanks! |
(Very glad to see you here @Eilon 😄) |
The C# extension and VS Code already show recommendations to remove unused
using
s in any open C# file. However the warnings for this same cleanup recommendation make it more difficult to find real issues in the project. Note projects w/ unusedusing
s build without warnings.The warnings in the IDE are inconsistent as well: VS code doesn't even show a recommendation to simplify the namespace qualification in the statement below.
For example, in a recently-created project using a VS template:
The text was updated successfully, but these errors were encountered: