VA Hashtags is a feature of Visual Assist that is a combination of named bookmarks and a task manager. VA Hashtags can be used for efficient navigation as well as an in-code todo list.
As a navigation tool, VA Hashtags are similar to the hashtags of social networks and microblogging services. Comments in code can be tagged with labels that make it easy for developers to find code with a specific theme. Developers create a VA Hashtag by placing the hash character # in front of a word or un-spaced phrase within a comment.
As an example, #main might make the entry point of an application easy to find for any developer using Visual Assist.
VA Hashtags must appear in comments; they are not preprocessor directives. However, they may occur anywhere within the comment, and a comment can contain multiple tags.
VA Hashtags as a Navigation Tool
A VA Hashtag that occurs only once in a solution typically defines a specific location. In addition to #main, examples include #ClassName and #DescriptiveNameOfThing.
VA Hashtags that appear multiple times typically connect unrelated code by theme. Examples of such hashtags include #bottleneck, #threadUnsafe, and #apiVersion4. Comments can include multiple VA Hashtags if the nearby code is associated with multiple themes.
Unlike bookmarks of Visual Studio, VA Hashtags are shared bookmarks because they get checked into source control. They move as code is updated and are accessible in all solutions to which files belong.
VA Hashtags as Task Manager
Actionable items, often those needing attention in the short term, can be tagged to identify the person responsible and nature of the assignment. Examples of VA Hashtags used to manage tasks include #MaryTodo, #MaryFixForNextBuild, #MaryRefactorThis.
Given the requirement that a VA Hashtag be an un-spaced phrase, details of the task are typically left to comments.
A search for the "tasks" associated with a VA Hashtag, e.g. MaryFixForNextBuild, finds all references to the hashtag in the current solution. With a filtered search, the references can be reduced to those associated with a single person, e.g. Mary. (See Filtering in the VA Hashtags Tool Window.)
Unlike the task list of Visual Studio, VA Hashtags do not need configuration, are automatically available to all developers of a solution, and operate consistently across file types.
VA Hashtags are case insensitive, hence #todo and #TODO are considered the same hashtag.
Completion of VA Hashtags
Suggestion lists and completion lists will include VA Hashtags when appropriate.
Search with GoTo Implementation or GoTo Related
From any one VA Hashtag, use GoTo Implementation (Alt+G) or GoTo Related (Shift+Alt+G) to locate all other references—in the current solution—of the hashtag. Select a reference to jump to its location in code.
When searching with GoTo Implementation or GoTo Related, references include exact matches only. Use the VA Hashtags tool window to search by substring, e.g. Mary.
VA Hashtags Tool Window
Use the VA Hashtags tool window to see all hashtags in the current solution, irrespective of who created or last edited them. The window is refreshed automatically so entries appear as developers create and delete the hashtags.
If the VA Hashtags tool window is not visible after installation of Visual Assist, open it with its default shortcut (Shift+Alt+H) or via the VAssistX menu.
One entry or node exists in the tool window for each VA Hashtag, and nodes can be expanded to see all of their respective references.
With focus in the tool window, navigate to a reference with Enter or Double-Click. Use the standard IDE navigation commands in the tool window to move to next (F8) and previous (Shift+F8) references. Navigation using these commands visits all hashtags in the current solution.
Use separate commands to navigate within a group, e.g. all references to a single hashtag. In the following example, visits will be restricted to references of #MaryRefactorThis.
By default, entries in the VA Hashtags tool window are grouped by hashtag. The entries can also be grouped by file, in which case each node represents a file and entries therein identify the VA Hashtags in each of the files.
Filtering in the VA Hashtags Tool Window
Filter VA Hashtags in the tool window using its edit control. Enter one or more substrings to reduce the display to contain only hashtags with the substrings. If you are locating a VA Hashtag to identify a location, you will likely see only one entry.
If you filter by a substring of VA Hashtags used for task management, you can see only those entries for which one developer is responsible.
Use negative filtering to exclude entries.
Use commas to search for entries that match any one of multiple filters.
Because the tool window refreshes automatically, entries will appear and disappear as respective hashtags are created and deleted in code—throughout the current solution.
Right+Click in the VA Hashtags tool window to hide hashtags. Scope of hiding is within the current solution only, and is one of:
- Tag: all occurrences of the selected hashtag, in the current solution
- File: all tags within a file, when opened in the current solution
- Directory: all tags within a directory and its subdirectories, when opened in the current solution
- Project: all tags within a project, when opened in the current solution
You can show hidden hashtags and unhide all of them using the context menu. You cannot unhide selectively.
Hiding applies only to the VA Hashtags tool window. Visual Assist may suggest completion of hidden tags, and GoTo Implementation (Alt+G) and GoTo Related (Shift+Alt+G) are available to jump to references to hidden tags.
Rules for solution-specific hiding are written to .vaHashtags in your solution directory. If you modify .vaHashtags externally, note that relative paths therein are relative to the solution directory and that you must restart your IDE before your changes take effect. The file may be placed under source control but if your copy of .vaHashtags is read-only, Visual Assist will not be able to amend the rules in it.
You can also hide hashtags from all solutions you open, not just the current one, by opening the extended context menu in the VA Hashtags tool window with Shift+Right Click or Shift+F10. Select a scope from the Global submenu.
Rules for global hiding are written to your roaming directory, in Visual Assist/VAHashtags/Global/.vaHashtags.
The VA Hashtags tool window updates in the background as you edit. You can force a refresh with F5 or via the context menu.
By default, tooltips in the VA Hashtags tool window show surrounding code and full pathnames.
You can disable the tooltips in the context menu of the tool window.
Cross-Referenced VA Hashtags
In some instances, code might be related in an ancillary manner to pieces already tagged by theme. In these cases, a VA Hashtag can mention—or cross-reference—another VA Hashtag without becoming a member of the themed group.
To designate a VA Hashtag as a cross-reference, precede its hash character with a word—or un-spaced phrase—and colon. Any word or un-spaced phrase that describes the type of cross-reference is acceptable.
When one searches for all references to a VA Hashtag, i.e. all those in the themed group, the cross-references are also available. In the case of search via GoTo Related (Shift+Alt+G), the direct references are separate from the cross-references.
Cross-referenced VA Hashtags appear in the VA Hashtags tool window. You can show or hide them using the context menu.
Visual Assist ignores words that are likely not hashtags, e.g. hexadecimals. Among the words ignored are those that:
- contain characters from only [0-9], [a-f], and [A-F], e.g. #100, #cafe, and #cafe100
- begin with 0x followed by any number of hex digits, e.g. #0xAA00FF00
- begin with two hashes, e.g. ##this
- are preceded by a letter or digit, e.g. foo.html#name
- are preprocessor directives or variants thereof, e.g. #includes bar.h
You can prevent hex-like words, e.g. #cafe, from being ignored by setting HashtagsIgnoreHexAlphaTags in the registry.
Minimum length of a VA Hashtag, not including the hash, is three characters. You can adjust the minimum by setting HashtagsMinTagLength in the registry.
By default, a VA Hashtag cannot include a hyphen. You can change the behavior by setting HashtagsAllowHyphens in the registry.
Several commands related to VA Hashtags are available for key binding.
By default, VA Hashtags are displayed in bold green. You can change the attribute and color in the options dialog for the IDE.
Visual C++ 6.0
VA Hashtags are not available
|DisplayGlobalHashtagMenuItems||Always display global commands in context menu|
|HashtagsAllowHyphens||Allow hyphens in VA Hashtags|
|HashtagsIgnoreHexAlphaTags||Make hex-like words acceptable VA Hashtags|
|HashtagsMinTagLength||Set the minimum length of a VA Hashtag|