Searching Source Code for Usages
Go Up to Locating Model Elements
The IDE enables you to track how an element or member is used in a Delphi source code project. The Search for Usages dialog box provides a flexible tool to find usages of classes, methods, variables, and overriding methods, derived classes and implemented interfaces.
The Search for Usages command is available:
- On the context menu of the Code Editor.
- On the context menu of the Delphi Class Explorer.
- On the context menu of an element in a diagram or in the Model View.
- Note that Search for Usages is not available for design projects.
To search source code for element usages
- Either select an element and click Search > Search for usages or right-click an element and choose Search for Usages on the context menu. The Search for Usages dialog box opens with the selected element shown in the Element to search for field.
- In the Search for Usages dialog box, check the following options, as required:
- Usages of the Element
- Usages of Members
- Usages of Derived Classes and Full Inheritance Depth
- Include Uses
- Skip self
- Select Scope.
- Click Search.
The search results are displayed in the Search for Usages window as a tree view. Each node shows all usages of an element in a certain class.
- Note that each new search adds its own tab to the Search for Usages window.
The Search for Usages window provides a toolbar with the buttons that enable you to expand or collapse the tree view nodes and repeat the search in the active tab with the same settings.
The context menu of the Search Result tabs provides the following commands:
Close the active tab.
Close all tabs
Close All Other Tabs
Close all tabs except the currently active tab.