Find References

Find References is available to find all usages of a symbol in a solution. Similarly named symbols of different contexts are ignored. This command saves time searching, and provides much more efficient access to symbols than Find in Files.

Output from Find References is placed in a Find References Results window, and you can jump directly to any of the references from the window. Results are grouped by project.

Find References Results

Place the caret or select any symbol and invoke Find References from the refactoring menu or the Visual Assist X toolbar. The results window populates with all references to your symbol.

Double click an entry in the Find References Results window to jump to the entry in your source. Visual Assist X opens the file containing the reference if it is not already open.

Hover over a reference and a tooltip appears with lines of code that surround the reference.


Find References Results

Icons in the Find References Results window indicate whether the references are used on the left sides or right sides of expressions, i.e. modified () or not modified (). Another icon () is used to identify definitions and declarations.



Find References results appear in bold and are highlighted as modified or unmodified to enhance visibility.

Multiple references on a single line in your source appear in multiple entries in the results window.

Click Clone Results in the Find References Results toolbar to save the result set in a new window, allowing you to find other references without losing your original result set.



In Visual Studio, the cloned Find References Results window can be docked or undocked like any other tool window. In Visual C++ 6.0, the cloned window always floats. To control this window's visibility in relation to other IDE windows, right-click the title bar and choose Stay on top.

Stay On Top

Highlight References in Source Windows

Click the checkbox in the top right of the Find References Results window to highlight all references to your symbol. Cancel the highlighting by unchecking the box or by pressing ESC within a source window.

If you press ESC and want to restore highlighting, return to the results window and click the checkbox again.

Highlight Find References

Two colors are used for highlighting references. One color is used to highlight references on the left sides of expressions and another for right sides. Make highlighting of references the default using the checkbox in front of the feature in the Visual Assist X options dialog.

highlightFindReferences.png

Visual C++ 6 users may specify the two highlight colors in the Visual Assist X options dialog.
Visual Studio users can specify both foreground and background colors for modified and unmodified references via the Tools | Options | Environment | Fonts and Colors property page of the IDE.



Finding References Over an Inheritance Chain

Select Inherited and overridden references from the Find References Results context menu to include inherited references from parent classes and overriden references in child classes in the results.



Find References in Code-Behind Files

For frameworks that employ a code-behind model, such as ASP.NET AND WPF, Visual Assist X allows you to find references in both design and code-behind files.



Navigation

Navigate within the Find References Results window using your keyboard, mouse or arrow keys. Shortcuts for Edit.GotoNextLocation and Edit.GotoPrevLocation make browsing of references efficient. Depending on your IDE and keyboard mapping scheme, the shortcuts are typically F4 and Shift+F4, or F8 and Shift+F8.

IDEKeyboard Mapping SchemeShortcuts
Visual Studio 2005/2008/2010 Default F8 and Shift+F8
Visual Studio 2005/2008/2010 Visual C++ 6 F4 and Shift+F4
Visual Studio .NET Default F8 and Shift+F8
Visual Studio .NET Visual C++ 6 No Defaults*
Visual C++ 6.0 Developer Studio Ctrl+Page Down and
Ctrl+Page Up
Visual C++ 6.0 Developer Studio F4 and Shift+F4**
*Recommend assigning Edit.GotoNextLocation to F4 and Edit.GotoPrevLocation to Shift+F4.
**Requires pre-existing text in the Output Window.


Navigation via shortcuts continues to work after you close the Find References Results window.

Options

Use the context menu inside the results window to control highlighting and other results properties.

Find References Context Menu

The Show Projects option adds project nodes to the results tree.

The Comment and string references option includes references from comments and strings. This operation is inexact by nature, but makes informed guesses based on proximity to lines where the symbol is used in context.

Miscellaneous

You can invoke Find References from a definition, reference or declaration of a symbol.

The most recent result set can be restored without restarting a search. Simply show the Find References Results window. In Visual Studio, select Find References Results from the VAssistX - Tools menu. In Visual C++ 6.0, customize your IDE menu or toolbars to include VisualAssistXFindReferencesResults.

Find References locates code within #ifdef blocks. Note that complex precompiler logic which alters the definition of a symbol based on a macro definition may interfere with the ability of Visual Assist X to correctly identify symbols. The FAQ contains information on mitigating this problem.

Copy text in the Find References Result to the clipboard by selecting an item and using the command Ctrl+C. Selecting a filename node will copy the text of filename and the references within it. Selecting a specific reference will copy only the text of that item.

Delete items from the Find References Results list with the Delete key. This is helpful when reading and checking a long list of references. Your source code is not modified.

Limit results to the current file only by using the Find References in File command in the VAssistX menu.

Search the Find References results list by clicking the binoculars icon.

Rename finds all references and lets you rename them.

See also Find by Context to move to the next and previous references from within the source window.

Find Reference works only for the current symbol. You cannot find references to a symbol by entering a name into a dialog.