VA Hashtags is a feature of Visual Assist that is a combination of named bookmarks and task manager. VA Hashtags can be used for efficient navigation as well as in-code keeper of tasks.
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.
Case Insensitive
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.
Navigating 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.
Navigating
When the text caret is in the edit control of the VA Hashtags tool window, the following keystrokes act within the tree of hashtags.
Keystroke |
Meaning within Tree of VA Hashags |
Up-Arrow |
Navigate to previous node |
Down-Arrow |
Navigate to next node |
Right-Arrow |
Open parent node if the edit control is empty |
Left-Arrow |
Close parent node if the edit control is empty |
Enter |
Open or close a non-navigable node; jump to location of a navigable node |
Hiding
Right+Click in the VA Hashtags tool window to hide and unhide hashtags. Depending on a setting in the options dialog of Visual Assist, scope of hiding is global or within the current solution, and is one of:
- Tag: all occurrences of the selected hashtag
- File: all tags within a file
- Directory: all tags within a directory and its subdirectories
- Project: all tags within a project
You can unhide all hidden tags using the context menu.
If you show hidden items as dimmed, you can unhide selectively.
Use multiple-select (Shift+Click or Ctrl+Click) to hide or unhide multiple hashtags in a single operation.
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.
Global Hiding
You can hide and unhide hashtags from the current solution or globally, i.e. from all solutions you open. Depending on a setting in the options dialog of Visual Assist, global hiding is available in 1) the default context context menu in the VA Hashtags tool window,
or in 2) an extended context menu opened with Shift+Right Click or Shift+F10.
Change the access via the options dialog for Visual Assist.
When enabled, the non-extended menu allows hiding from the current solution and from all solutions.
Locations of Hiding Rules
Rules for solution-specific hiding are written to $(SOLUTIONDIR)\.va\user\.vahashtags by default. Designated users can maintain the file, then copy it manually to $(SOLUTIONDIR)\.va\shared where the rules will be active for all users of Visual Assist.
Rules for global hiding are always written to APPDATA\Roaming\Visual Assist\VAHashtags\Global\.vahashtags. (Rules for global hiding are not shared.)
Hiding a hashtag globally, i.e for all solutions, adds a rule to APPDATA, not the solution-specific set in .va\user\. If you want to hide a hashtag for your team and hide the hashtag globally for yourself, you must hide the hashtag for the solution before hiding it globally. If you inadvertently hide first the hashtag globally, unhide all global hashtags, then redo the hiding: solution before global.
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.
Visual Assist build 2270 and older
Solution-specific hiding rules are be written to $(SOLUTIONDIR)\.vahashtags, where they can be checked into source control and shared, but cannot be easily maintained by designated users and only read by others.
Refresh
The VA Hashtags tool window updates in the background as you edit. You can force a refresh with F5 or via the context menu.
Tooltips
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.
Ignored Hashtags
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.
Hyphens
By default, a VA Hashtag cannot include a hyphen, e.g. only "foo" of "#foo-bar" is recognized as a hashtag. You can change the behavior, thereby allowing all of "#foo-bar", via a setting in the options dialog for Visual Assist.
Hexadecimal Strings
By default, candidate hashtags that contain only alpha characters a-f and A-F, e.g. #Bad, are considered to be hexadecimals. You can make Visual Assist consider the strings to be valid VA Hashtags via a setting in the options dialog for Visual Assist.
Note: Visual Assist ignores strings that contain both hexadecimal characters and digits, e.g. #Bad1, irrespective of the setting.
Minimum Length
By default, the minimum length of a VA Hashtag, not including the hash, is three characters. You can adjust the minimum via a setting in the options dialog for Visual Assist.
Keyboard Shortcuts
Several commands related to VA Hashtags are available for key binding.
Color
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