Vous êtes sur la page 1sur 18

VS10x Cdigo Map v2 Overview

VS10x Code Map is a Visual Studio 2012/2010 extension that displays a graphical nested representation of the current code editor window (C# and VB.NET). It helps the developer visualize type nesting, implemented interfaces, regions, member type and scope , as well as quickly navigate to their respective positions in code.

Details
1. Code Visualization
Have a look at the small sample below. Notice the way nested types are represented, as well as the implemented interface. The region sub-container is prefixed with a # symbol for easier identification. Members have distinctive icons, with special overlays for constructors, public items (not pictured in the below example) and members belonging to implemented interfaces. With Visual Studio 2012 Light UI Theme (detail: the first property icon is lighter because private members are dimmed):

With Visual Studio 2012 Dark UI Theme (detail: the first property icon is darker because private members are dimmed):

With Visual Studio 2010 (a dark theme can also be selected):

2. Code Collapsing and Sync


Most containers can be collapsed (exception: interface containers) in order to help you stay focused on items that are currently in development. What's worth to notice is that a collapse operation in the Code Map will also collapse the corresponding part in the code editor . Moreover, it works both ways, so if you for example collapse a class in the code editor, the corresponding container in the Code Map will get collapsed as well!

3. Persistent History
The Code Map is also a navigational tool - if you double-click an item, its position in code will be brought into view. That is something you should expect, of course, but the Code Map also makes returning to the last viewed/edited members a breeze by highlighting the last 5 accessed or edited (C# only) items in various ways: In the Code Map, with a bluish clock dial icon to the right of the item's graphical representation, the icon opacity reflecting the item's recentness in the local history. In the editor, with a bluish background color for the entire member body (can be turned off). On the Scroll Map (a special area added by the Code Map to the left of the vertical scrollbar), blue rectangles are added to represent the member position relative to the entire code file (you can align the scroll thumb with the blue marker to bring the item into view) (can be turned off).

Please note that the above behavior is fully customizable, there's a Code Map Options dialog where this can be done.

4. Highlighting Items with Color Labels


Now, highlighting recently accessed items may be good, but what if you have items you return to over and over? Well, you can specify a special highlight by applying a color label (yellow, red, green, blue, purple, gray). As with history, labeled items are emphasized in various ways: In the Code Map, with a colored background applied to the item's name. In the editor, with a colored background for the entire member body; the color is the same as the one used to highlight the item in the Code Map (can be turned on or off by default from the "Customize" dialog, and can be later reset on a per-item basis by using the item popup menu). On the Scroll Map (a special area added by the Code Map to the left of the vertical scrollbar), red rectangles are added to represent the member position relative to the entire code file (you can align the scroll thumb with the blue marker to bring the item into view) (can be turned off).

The behavior for the above last two emphasizing techniques is customizable.

5. Named Bookmarks
In large code files, a code elements-based code map might not be enough. If you find yourself looking over and over for certain positions in code, then named bookmarks are for you. Simply start a comment with the BMK token and then type in a meaningful name (this will end up with something like //BMK Some name here in C# or'BMK Some name here in VB) and VS10x Code Map will pick that up and add the name at the top of the containing element, so that you can find it instantly.

6. Filtering
This is a bit experimental from a UX perspective, as we are planning for it to be part of a much bigger picture. However, since it is fully implemented from a functional perspective, then maybe somebody needs it, so we decided to publish it. In order to use filtering, just hover your mouse over the narrow orange bar at the top of the Code Map area. A textbox will appear where you can enter the filter text. In order to cancel an existing filter, either right-click the filter textbox, or press Esc while in the filter textbox. The filter textbox can be configured to be visible all the time (that is, its auto-hide behavior can be disabled).

7. Color themes
The base color used for the Code Map interface can be specified by the user (blue, red, green or grayscale), with results as illustrated below:

You can even use an 'alternating colors' theme. When selecting this one, neighboring/nested containers are given different colors (if possible) for additional visual distinction:

Also, for developers using a dark theme, Code Map also has the option to use a dark background color and a 'Dark' theme, with the following result in VS 2010 (for the VS 2012 version, please scroll to the top of this document):

Options
The Code Map appearance and behavior can be customized by using the VS10x Code Map Options dialog box, which is accessible from the right-click popup menu over the Code Map area:

Changelog
2.97 - Feb 12, 2013 New: 'Items in history' highlight kind selection, with new visual emphasis style choices inspired from the color labels feature. Can be configured in the "VS10x Code Map - Customize" dialog box (seethis blog post) . 2.96 - Feb 06, 2013 New: Track editor viewport i.e. emphasize all items that are currently visible in the code editor. Seethis blog post for details. Revised: When set to autohide, now only the "VS10x Code Map" text area is sensitive to mouse hovering (instead of the entire collapsed margin) for showing the Code Map. Fix: In the 'Customize' dialog, several child options' enabled states were decoupled from their parent option (in terms of UI controls).

2.95 - Jan 29, 2013 In case of an initialization failure, debug information was repeatedly written to the Code Map window. Fixed an exception condition when checking if a member is part of an (eventual) implemented interface.

2.94 - Jan 17, 2013 "Rename" refactoring can now be triggered directly from the Code Map popup menu (i.e. on the selected Code Map item).

BugFix: when opening a C# document of a reasonable size with "active tracking" enabled, if the popup menu was quickly opened (i.e. before the active item was tracked in the Code Map) then any operation launched through that popup menu was executing on the newly tracked item instead of the Code Map selection. BugFix: Storing CodeMap settings at project root location failed sometimes.

2.93 - Jan 10, 2013 The Code Map popup menu is customizable now (see the 'Customize' dialog). Full redesign of the 'Customize' dialog box, both in terms of categories and organization. Code Map did not persist its data (color labels, history) anymore. Fixed.

2.92 - Jan 03, 2013 Added an option to allow customization of the folder where Code Map stores its data file (i.e. the 'vs10x'-extension file). As a small note, this file holds project-specific data, i.e. history, color labeled items, etc. Some people might prefer to have this out of their way (it can be stored at an AppData-based folder under a GUID-based file name) while others might prefer to have it in the project root folder ( as a 'project_name_and_ext.vs10x' file) for backup and project copy/move purposes. Slight reorganization on the first two tabs of the "VS10x Code Map - Customize" dialog box, as a result of the above.

2.91 - Dec 19, 2012 Load time optimizations in certain scenarios for C# documents.

2.90 - Dec 11, 2012 Filtering the Code Map contents (i.e. by using the 'Enter text to filter by...' textbox at the top of Code Map) was not displaying class-type matches. Implemented generic interfaces were incorrectly represented by Code Map if the code document was a Visual Basic file. Event interface implementations were incorrectly represented in the Code Map if the code document was a Visual Basic file. In C# documents, filtering was incorrectly including all explicit interface member implementations for implemented interfaces whose names matched the filter. Generic interface type names/tooltips and implemented generic interface names/tooltips now display the more easily distinguishable short type names instead of CLR names. Implemented generic interfaces were not fully displayed (i.e. they did not include generic parameter information) in a class container's name and tooltip.

2.89 - Dec 05, 2012 When using solution folders to organize projects, Global Solution Shortcuts were not persisted between VS sessions. It was not possible to delete two Global Solution Shortcuts consecutively.

2.88 - Nov 26, 2012 If loaded in VS 2012, Code Map will display optimized UI elements (i.e. square corners, minimal or no gradients, blue selection). This is not a customizable.

Some changes to UI elements when displayed in VS 2010, while maintaining the VS 2010 look-and-feel.

2.87 - Nov 19, 2012 Critical: Code Map initialization could end up in a loop in certain conditions. Fixed. Fixed a versioning issue, especially important to users having the full CodeSMART suite or other VS10x extensions installed. Started to use the bottom row (which contained the version info label) for actions. Currently, fast access to the Customize dialog and to this web page are provided.

2.86 - Nov 06, 2012 Added color labeling support for region items. Added a popup menu to the filter textbox with standard cut-copy-paste items plus an "Always Visible" checkable menu item. When the mouse pointer moves out of its area, the filter textbox stays visible a little longer (that is, when not instructed to be always visible). Some visual tweaks to the filter textbox.

2.85 - Oct 31, 2012 Icons for member overrides (i.e. functions, properties with "override") have a distinctive glyph now. The constructor icon glyph was difficult to read when using the "VS 2012 Dark" icon theme. Fixed. Non-"code element" type items now have informative tooltips. Attempt to fix the not-initializing Code Map issue (i.e. an empty Code Map with only a "Not active (not scanned yet)" message being displayed).

2.84 - Oct 25, 2012 Icons for container-type items (i.e. for classes, interfaces, enums, structs, delegates) now have access scope glyphs. Filtering the Code Map yielded no effects on the "Global Solution Shortcuts" contents. Fixed. A more detailed message for items that could not be scanned.

2.83 - Oct 15, 2012 The Code Map now also displays delegates. In order to avoid confusions, type icons are displayed by default now for container items. This can be changed in the "Customize" dialog. The "What's new" balloon info appeared multiple times if both VS 2010 and VS 2012 were installed on the same system and they were using different versions of VS10x Code Map.

2.82 - Oct 08, 2012 When manually refreshing from the Code Map popup menu, settings changed in other Code Map windows were not automatically taken into account. Fixed.

Added an option to control whether the 'Global Solution Shortcuts' should be expanded by default or not (see the 'VS10x Code Map - Customize' dialog, the 'General Settings' section).

2.81 - Sep 27, 2012 The "Filter by" textbox background color did not change according to the theme (i.e. it was white on the dark theme). Fixed. Tooltips for VB property-type code map items had no item kind detail text. Fixed.

2.80 - Sep 21, 2012 Tooltips for C# and VB function-type code map items had no scope detail text if the underlying function was non-public. Fixed. Tooltips for C# and VB property-type code map items had no scope detail text if the underlying property was non-public. Fixed. Tooltips for VB property-type code map items had no type detail text. Fixed.

2.79 - Sep 10, 2012 Further tuning of the "VS 2012 Light" and "VS 2012 Dark" icons themes.

2.78 - Aug 31, 2012 Visual Studio 2012 icon themes (for both light and dark VS 2012 UI themes). Code Map defaults to the "VS 2010" icon theme for Visual Studio 2010 and to the "VS 2012 Light" icon theme for Visual Studio 2012, but these can be overriden "VS10x Code Map - Customize", the "View" category. If two implemented interfaces had members with the same name, Code Map would only mount one of the members. Fixed. Members belonging to generic interface implementations were not represented correctly in the Code Map. Fixed. Generic interface implementation containers were not represented correctly in the Code Map. Fixed.

2.77 - Aug 27, 2012 Nasty problem: Fixed situations with perfectly normal C# and VB files that displayed the "VS10x Code Map is not available in this document" message, obviously with no Code Map available when that happened..

Contact Information
Have suggestions ore require assistance? Please write us at support@axtools.com - we *will* get back to you! Also, it would be our pleasure to have you as a guest at www.axtools.com where you will be able to find other developer tools we have created. Thank you!
http://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2

Vous aimerez peut-être aussi