-
Notifications
You must be signed in to change notification settings - Fork 677
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
Add option to make 'unnecessary using directive' diagnostics to appear #1429
Comments
vscode 1.12.0, c# extension 7439ef4 commit (after 1.9.0 release) - same behaviour. |
This is by design. We suppressed this message in the PR to #1231. Eventually, we hope to have faded code support in VS Code so we can provide this information a bit more unobtrusively (microsoft/vscode#20219 tracks this). Note that the light bulb still appears and works if you move it to an unnecessary using, but we will no longer spam unnecessary using diagnostics. |
At least don't agree with removing the wavy underline in the editor for those unnecessary using directives! without those signs in the editor so we cannot spot them anymore, would u expect us to move the cursor each line by line in each .cs file to find out unnecessary using directives?! this change makes the |
I appreciate your passion @cateyes99! Unfortunately, VS Code doesn't make it possible to remove the item from the Problems list (which many complained about) while keeping the squiggle in the editor. If you like, you can file an issue (or submit a PR) to make this behavior optional. And, eventually, I hope we'll have the ability to fade code as I mentioned before to make this behave more like it does in Visual Studio (in VS, we fade unnecessary using directives but don't just the message in the Error List). |
@DustinCampbell pull request to make this configurable. |
Nice! I've re-opened, assigned to you, and put in our 1.10 milestone. Thanks very much for the contribution! |
Adding the same comment I put in the PR here:
|
@DustinCampbell Probably don't want to go down this route, but this extension could provide unused usings via decorations rather than diagnostics. The TypeLens extension currently does this: https://github.com/kisstkondoros/typelens/blob/master/src/extension.ts#L96 |
Environment data
dotnet --info
output:VS Code version: 1.11.2
C# Extension version: 1.9.0
Steps to reproduce
Add an unnecessary using statement.
Expected behavior
A diagnostic info message about the unnecessary using statement.
Actual behavior
No diagnostic info message is shown and the using statement is not highlighted.
The text was updated successfully, but these errors were encountered: