Wednesday, November 19, 2008

Adding folders to the Class View in Visual Studio

I didn't know this, but you can add folders to the Class View. You can then drag classes to it.   What's even better, you can drag methods to it!

Thanks to Sara Ford for her post describing this.

There's more good news! When you're editing code in the editor and you're over a class or method, you can use the 'Synchronise Class View' command (I've mapped mine to a keyboard short-cut, but you can add a toolbar item) to synchronise the Class View to the item you're currently editing.  Once synchronised, you can go to Class View and drag that into one of your folders.  Also, when you do this, you won't upset any of your team with changes to the solution or project files - because these are your settings, and hence are stored in the .suo file (which, on the other hand could be a pain, because user option files shouldn't be checked into your source repository).

Anyway, this is the next best thing to a 'bread-crumb' feature in the editor that let's you jump around to favourite places in the the code.   Maybe the bread-crumb feature will be in the next version of ReSharper?

3 comments:

Ilya Ryzhenkov said...

Not exactly bread-crumbs, but may be "recent edits" feature can help you?

Steve Dunn said...

Recent edits is a great feature, but I run into the following scenario a lot:
1. I look at class I'm interest in.
2. It calls off somewhere else, so I go and have a look there
3. That calls off somewhere else, etc. etc.
4. I now need to trace my steps back. I haven't edited any code so recent edits won't help. I could use Ctrl+[minus] but that's too fine grained. I just want to lay breadcrumbs at interesting points and easily roll back to them.

CodeRush does this very nicely.

Ilya Ryzhenkov said...

I see, thanks for feedback!