Synchronize Class View
A week or so ago a developer who was starting to use VS 2005 mentioned that he was a big fan of the Class View and was disappointed to see that it was no longer possible to synchronize the Class View with the editor. In VS 2003 this was possible via a command called ‘View.SynchronizeClassView’ that appeared on the editor context menu. This command was removed in VS 2005 based off of the command usage data collected during the Beta and CTP releases, in an effort to reduce clutter.
The good news is that the command was only removed from the menu, not the product. The better news is that Visual Studio actually has an extensive mechanism for customizing layout, including the names, order, icons, etc. of commands that appear on menus.
In order to move the command back onto the editor context menu, follow these steps:
1. Select Tools | Customize…
2. In the tabbed dialog that appears, search through the checked list box list, on the “Toolbars” page, for an item called “Context Menus”. Check it.
This causes a new toolbar to appear at the top of the screen underneath the toolbars that are already showing. This toolbar is only visible when the Customize dialog is showing.
3. Change the active page from “Toolbars” to “Commands” (on the Customize dialog)
4. In the Categories list box, select View
5. The right-hand pane, “Commands”, will be updated to show all of the commands prefixed with “View.” Scroll through that list and find SyncrhonizeClassView (the list is alphabetically ordered).
6. Drag that command from the “Commands” list on to the Editor Context Menu | Code Window item in the toolbar that appeared when we selected “Context Menus.” You can put it wherever seems appropriate on the menu.
7. Close the Customize dialog
The editor context menu now contains the command, and whenever you’re in source you can right-click and select Synchronize Class View, just as in VS 2003. This same process can be used to change the order of commands that appear on the menus, their names, the icons associated with them, their accelerator keys. You can even delete commands that are cluttering the menu that you never use. These customizations can even be preserved into a .vssettings file and shared on multiple machines or with coworkers.
The question got me thinking about Class View and how people are currently using it. I’m curious:
- Do you use Class View? (If not, do you use any tool that works like Class View, the Navigation Bar, or maybe an addin?)
- If you use Class View, do you tend to use it for navigation, browsing, or both?
- Class View used to provide a set of ‘Add’ commands for adding new methods and classes. Did you use those? Do you miss them in 2005?
- Do you like the split screen view of the Class View vs. how it appeared in VS 2003?
- What requests do you have for Class View in the future?
Comments
- Anonymous
December 13, 2005
WOW! This ability to customize context menus is very useful. I use them extensively in the code window and the solution explorer, and didn't know it was so easy to add my own commands. I've long wanted a context menu to make a source code file writable to make quick changes without checking the file out. - Anonymous
December 15, 2005
I do not use it currently, however in a future where files would not be utilized in the manner of class.cs or such and one class could contain multiple languages along with good editor support for that, I would be willing to move from the current file/directory oriented view to a view based more on assemblies and types/classes perhaps. One xml based file could contain multiple source languages and represent one assembly for instance. - Anonymous
December 21, 2005
Thank you!!!
I was about to throw my keyboard through the window - I use Synchronize Class View a lot when browsing a large body of new code. What made it more frustrating was that the documentation still insists the command is there.
The cusomization mechanism is neat once you find it - I feel in control again. - Anonymous
July 14, 2006
This is nice... but I cannot get it to work for projects in solution folders... Any ideas? - Anonymous
August 03, 2006
I was disappointed. But now i am glade to see this menu item again. - Anonymous
August 21, 2006
Dude, I love you. ;-)) - Anonymous
October 03, 2006
Jeroen, I can't get the View.SynchronizeClassView to work with solution folders either. It doesn't seem to matter whether I invoke the command via a shortcut or from the command window. The command works if I promote a nested project from the solution folder up to the root solution. Guess I will give up on solution folders for now. /SHRUG ResponseYou're both right. I've filed a bug that this isn't working with solution folders. - Anonymous
October 08, 2006
Hi Anson, I just found this page through Google. Awesome. The lack of "synchronize class view" has kept me from switching to VS2005. That and the split class view. On a small monitor (i.e. Laptop) I find the split class view nearly unusable. If you have any influence on this, please please please bring the merged class view from VS2003 back as a configurable option. ResponseI'll forward this feedback to the folks responsible for Class View in the next version of Visual Studio. I doubt it'll be something that can be uniformly reverted, since there are bound to be people that have exactly the opposite opinion (it's too hard to navigate when it's got only a single pane). It's possibly a place that deserves a configuration option. - Anonymous
November 28, 2006
These transcripts will eventually be published here , but while we're waiting for that to occur, I'll - Anonymous
December 19, 2006
I cannot understand how people cannot use the classview intensively when navigating through any code whether simple or complex. It is the only place where you see in one glance everything about a class.Not being able to synchronize was a real pain for me and your post is going to save me a lot of pain!thanks!!! - Anonymous
January 14, 2007
Great! This is very helpful reminder because I keep forgetting this from one VS2005 reinstallation to another :) Thanks! - Anonymous
April 09, 2007
Thank you very much Anson. This was excellent information and your instructions were easy to follow. I heavily use and rely on the ClassView. I work on large projects that have large collections of classes and source files. Having a macro-view of the class makes it so much easier to find what I'm looking for since people rarely if ever take the time to manually alphabetize the location of their functions.Again Thanks Much !!! - Anonymous
April 17, 2007
I second that. I HATE the split class view. I can't see how it's any kind of gain. The bottom part of the view occupies space all the time, mostly to no purpose. And then, when you've managed to find the class you want, in your reduced class view area, you have to scroll in that tiny bottom part to find the method you want. I believe this kind of UI problem is addressed by a neat innovation known as the TREE VIEW.BTW, I have a 21" monitor, and it's still terribly uncomfortable to work with. It's clearly a massive productivity hit. - Anonymous
April 21, 2007
"Class View used to provide a set of ‘Add’ commands for adding new methods and classes. Did you use those? Do you miss them in 2005?"yeah, I miss them! are they gone, or just removed from the menu by default. I tried adding them back with the technique described above, but it didn't seem to work (the menu items were greyed out).is this yet another regression we have to trade for all the "improvements"? - Anonymous
July 03, 2007
Fantastic. You've saved my life as well. Thanks.If only there was an equivalent Synchronise Solution Explorer option!! - Anonymous
August 23, 2007
very helpful for guys come from IntelliJ - Anonymous
September 05, 2007
It would be useful if the class view would be permanently synchronized, i.e. if you change the file in the editor window, the correct class should be highlighted.Patrik - Anonymous
October 08, 2007
Hi Anson,fortunately I found your link on Google: recently I changed the PC and didn't remind how to configure this option on VS2005. Thanks!I use Class view sometimes, but would like to use it more often.For me, it would be great if there were a way to synchronize the Class View with the Code Editor: when writing code I like to think about classes and methods, not about files (like in Solution Explorer). And also I want to see different views of my class, for example only the public interface. The "split view" is very usefull for this purpose.Instead of the "Track Item in Solution Explorer" option, I will find more usefull a new option: "Track Item in Class View".Look at Eclipse IDE for Java, for example. - Anonymous
October 15, 2007
Excellent, NOW I'm going to use the class view again.Many thanks to the author for sharing. This should be at least a configuration tickbox! - Anonymous
November 20, 2007
you're a lifesaver!When switching between eclipse and VS this was severely lacking - Anonymous
November 26, 2007
PingBack from http://feeds.maxblog.eu/item_675952.html - Anonymous
November 30, 2007
Én ritkán, olyannyira - elöljáróban, VS 2005-ről van szó, némi VS 2003-ra emlékezéssel -, hogy most jutottam - Anonymous
January 23, 2008
class view is very useful. I use it for visualizing and navigating. All major java ide's can synchronize to class view automatically as you move through your code. It would be nice if Visual Studio didn't make you go through a context menu. A keyboard shortcut would be better and automatic would be best. Does anyone know how to configure VS to do that? - Anonymous
April 16, 2008
will be great to show inner classes in class members view - Anonymous
April 22, 2008
Finaly the class view gets usefull again.Without sync it's a pain in a large project.thanks 1000* - Anonymous
October 22, 2008
Class view on KDevelop works soooo much better. Why dont you guys steal that IDE's design. - Anonymous
October 22, 2008
Thank you AnsonH, thank you, and did I mention THANK YOU?Although this is a beautiful nugget of information and the MSDN site is full of them...it would be nice if the MS engineers would simply add this back to the VS code popup menus rather then making us developers lose valuable time in scouring MSDN for useful features we had previously grown quite accustomed to using. - Anonymous
December 17, 2008
The comment has been removed - Anonymous
January 20, 2009
PingBack from http://www.hilpers.com/1030922-synchronize-class-view - Anonymous
June 18, 2009
PingBack from http://barstoolsite.info/story.php?id=7367