Roslyn: Automatic removal of unnecessary using statements

Created on 17 Mar 2016  路  6Comments  路  Source: dotnet/roslyn

Version Used: C# 7 feature request

Steps to Reproduce:
Right now the IDE inform me of the using statements that are not necessary and gray them out.
It will be awesome if instead of graying them out it will delete the lines automatically so I don't have to.



    1. 2.
  1. 3.

Expected Behavior:

Actual Behavior:

Area-IDE Resolution-Won't Fix

Most helpful comment

This feature already exists; just use the smart action.

Doing that automatically is a horrible idea, because there is no point in which it's safe to do so.

You're asking to make it impossible to write a using statement before the code that uses it.

All 6 comments

This feature already exists; just use the smart action.

Doing that automatically is a horrible idea, because there is no point in which it's safe to do so.

You're asking to make it impossible to write a using statement before the code that uses it.

This isn't a language proposal.

@josejmoran I'm not sure I understand the proposal - at what point would you like us to remove them?

Looks to be a troll having some fun; see all suggested issues: https://github.com/josejmoran

GitHub Feature Request: Automatic removal of this guy.

You should check out the VS Power Commands extension, which allows you to invoke Remove Unnecessary Usings on save of a file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gafter picture gafter  路  258Comments

ghost picture ghost  路  229Comments

ilexp picture ilexp  路  167Comments

gafter picture gafter  路  279Comments

gafter picture gafter  路  147Comments