Most Favorite VS2005 Item

Published 21 December 05 03:52 PM | mhawley

So as I’ve been playing around with VS2005 and the 2.0 framework, my mostest favorite new addition in the C# IDE is being able to write a type and have it intelligently tell me “HEY! I don’t know where that type is!” and give me the option to either fully qualify it or adding in a “using” statement. Whenever you see the red line underneath a type when your cursor is in the word, simply press Shift+Alt+F10, then Enter. And voila! you know have a new using statement. The only downside, is that this only works when the assembly that type is contained in is referenced in your project. Ohh - and if you like using the mouse more than the keyboard, just hover your cursor over the red line and it’ll allow you to do the same thing.

Update: If you’re looking for the keyboard shortcut for this, its called “View.ShowSmartTag”. I just added Shift+Alt+Space which is a lot easier on the hands as I don’t have to hunt for F10.

Filed under:

Comments

# BZG said on December 21, 2005 07:58 PM:

Awesome!

# Frans Bouma said on December 22, 2005 03:55 AM:

I've bound that action to cntrl+, as shift+alt+f10 is for people with 5 hands of a meter wide, each, and I'm not one of them.

# .Net Adventures said on December 22, 2005 09:45 AM:

This addition was in VS2003 with Jetbrains Resharper .Very useful...

# Matt Hawley said on December 22, 2005 10:07 AM:

Yeah, I'm thinking of binding it to another shortcut, something I can do with my hand very quickly, maybe like Ctrl+Alt+Space or something.

# Nicole Calinoiu said on December 22, 2005 11:52 AM:

If you're a big user of auto-inserted using directives, you might find my little add-in (http://bordecal.mvps.org/Nicole/ImportsSorter/Default.htm) for sorting the beasties to be helpful. (From the command list available for keyboard shortcuts, it looks like someone had meant to add sorting functionality to the IDE itself but, at least as far as I can tell, it doesn't appear to have been implemented.)

This Blog

News

.NET Links

Blogs I Read

Syndication