Searching for Symbols: Objects, Definitions and References
Since the Object Browser is capable of displaying a large number of objects and members, it is important to be able to find symbols of interest quickly and easily. You can use the Find Symbol dialog box to easily find such symbols or to locate sections of code that use the symbol.
Find Symbol is useful for:
- Searching for definition of a symbol within your project. Also useful for discovering multiple definitions of a symbol.
- Searching for uses of a symbol (references) within your code.
- Discovering names of objects and members in referenced and external components, allowing you to learn about its functionality.
- Finding symbols and browsing to their definitions in the Object Browser to discover their syntax and other information.
Find Symbol is different from finding text in that it:
- Allows you to limit the search scope to include only symbols, ignoring text in comments.
- Definitions and references (when available) to the symbol are clearly indicated in the Find Symbol Results window.
- Allows you to search in external components for which you do not have the source code.
The scope that Find Symbol uses in its search is the same browsing scope currently in use by the Object Browser. Changing or customizing the scope here also updates the display in the Object Browser.
To open the Find Symbol dialog box, either click the Find Symbol button on the Object Browser toolbar, or on the Edit menu, click Find and Replace and then Find Symbol.
To find a symbol
- In the Find what box, enter all or part of the name of the symbol you want to find.
- You can limit the search by specifying the browsing scope in which to search. In the Look in combo box, select either Active Project or Selected Components. Active Project confines the search to the active project and its referenced components only, while Selected Components searches within the user-defined browsing scope, which can include projects and their referenced components as well as other external components.
- If your search scope is set to Selected Components, clicking the ellipse (...) button displays the Selected Components dialog box which allows you to change the Selected Components browsing scope. Note that this also updates the display in the Object Browser.
- You can further refine the search by specifying search options. Select either Match substring, Match whole word, or Match prefix. In addition, you can check the Match case check box if you want the search to be case-sensitive.
- After specifying the criteria, click the Find button to perform the search.
The results of the search display in the Find Symbol Results window. You can navigate to the symbol in code by either double-clicking the result or by choosing Goto Definition from its context menu. For external components, you can browse to their definition in the Object Browser from here as well. If references are available for the symbol, you can expand the node to see its uses in code and navigate to them.