Converts the full-form type reference into the short form. This Refactoring removes the redundant type qualifier from types referenced using its full form (e.g., System.Text.StringBuilder) and adds the corresponding namespace reference if it does not already exist. This makes your code more concise, although it can decrease readability in special cases.
Available when the cursor is on a type referenced using its full form.
Place the caret on a full-form type reference.
The blinking cursor shows the caret's position at which the Refactoring is available.
After execution, the Refactoring removes the namespace from its reference and ensures it is referenced.
using System.Text;
namespace CRRDemo {
class Program {
static void Main(string[] args) {
var o = new StringBuilder();
}
}
}
If you need to remove the type qualifier from all full-form type references in the current file, use the Remove Type Qualifier (remove all) Code Actions Menu item.