VS2010 Code Editor helps you navigate around your code
|
The VS2010 editor has been rewritten in WPF enabling many more ways to visualize your code. I've been poking around to see some of these improvements and thought I would share my discoveries. The first (and most obvious to me) new feature shows up when you select a property, variable or method in your code. All other instances of that item which are in scope will also be highlighted. For example, in this screenshot, I clicked on one of the instances of the entsets variable (note that I did not double-click and select the entire word). Then all of the other entsets were automatically highlighted. entsets is private to this extension method.
If I had selected a variable which ws scoped to a class, not a method, then all of the other instances of that variable would be highlighted. Another nice features is that if you hover your mouse on the border of the editor window, the method that is to your right will get highlighted.
Rest assured this is just a WPF UI trick. The text is not being selected so you don't have to worry about accidentally overwriting anything. Another really great feature is the sequence diagram. This will be invaluable to devs who inherit code. The diagram provides a visual map of your code. In these screenshots I have selected the GetEntitySetFullName method and right clicked to get a context menu.
In the wizard, I changed theMaximum call depth to 5 so that I follow the call path of my method.
Here is part of the resulting map.
Unfortunately, there seems to be no way to resize the image or save it. I imagine those obvious features will be coming. Another great tool for getting the "bigger picture" of your code is the Call Hierarchy view. Check this out.
You can see what methods call GetCustomerswithRelatedData as well as what methods it calls.
And you can expand each method to see what its hierarchy is as well. Very very useful!
|








