Welcome to MSDN Blogs Sign in | Join | Help

Automatically qualifying class names

Have you ever wondered if it was possible to just go on coding without having to always first go and write the using or the Imports statement in C# or VB or J# or how about just fully qualifying the class names in place by using a keyboard shortcut. Well Visual Studio 2005 currently provides a simple mechanism of doing exactly this. For your example, if you had the statement without having the required using statement,

private StringBuilder sb;

then with the cursor on 'StringBuilder', the keyboard shortcut Shift+Alt+F10 will provide you the options of either adding a 'using' statement or fully qualifying the class in place.

In addition, the code editor also provides a hint that you need to qualify the class by showing a small red rectangle at the end of the class name. If you hover over that rectangle you will see a small drop down. This drop down also provides you with the same options as the keyboard shortcut.

Published Saturday, November 12, 2005 1:01 AM by ChetanC

Comments

Friday, November 11, 2005 10:44 PM by TAG

# re: Automatically qualifying class names

Wow .. What the heck happened to Ctrl + . shortcut ?

Pressing three keys for such a simple thing is overcomplicated !
Friday, November 11, 2005 11:50 PM by dhchait

# re: Automatically qualifying class names

Resharper does that as well for those still using VS2003.
Wednesday, November 16, 2005 1:10 PM by saraford

# re: Automatically qualifying class names

The Ctrl+. shortcut still works (given you are in the General Development Profile, i'm not sure about the other profiles). Both Shift+Alt+F10 and Ctrl+. are bound to View.ShowSmartTag

thanks!
Anonymous comments are disabled
 
Page view tracker