# Navigation Tools – Go To Declaration and Find All References

The context menu of the Script Editor has two navigation tools:

- Go To Declaration quickly navigates to the declaration of a selected element.
- Find All References finds where a symbol is used.

These commands are available either in the context menu by right-clicking any part of the script (as shown below), or by pressing their respective hotkeys.

Tool | Hotkey | Description
Go To Declaration | F12 | Jumps to the declaration of an identifier (WebPage Elements Event Handler Scripts, local variables or functions) as follows: For In-Sight ViDi PC Tags and $ Functions, it opens the Tags Window and highlights the relevant row. For Event Handler Scripts, it opens the script document in a new tab. For local variables or functions, it jumps to the declaration of the identifier in the script. If the tool cannot find the declaration of the selected element, the Unable to navigate to declaration message is shown. Tip: Use Go To Declaration to find out what the selected identifier does within a script, and to check if it has been properly declared. See the below example: It may not be clear what the checkWithCasing and checkWithoutCasing parts of the hasCase argument are doing. However, by selecting them and using the Go To Declaration tool (one at a time for each, as shown in the left image below), the Script Editor jumps to the line of the script where the selected element is declared (as seen in the right image below). In this example, these elements turn out to be custom functions.
Right-clicking on the checkWithCasing element, then clicking on Go To Declaration. | The tool then jumps the cursor to the part where checkWithCasing is declared.
Find All References | Ctrl + F9 | Finds where the selected tag is used by listing all reference locations in the Search tool window. Tip: Use this tool in large jobs containing multiple Web Pages and scripts to check the following properties of a specific tag: The purpose of a tag in a job, especially when it cannot be clearly identified by its name, as seen in the below example (where the tag is simply named $tag): Based on the results of the search, $tag is probably used to indicate status. The impacts of changing the selected tag. It is recommended to use the tool and find all references before changing the name of a tag. This gives you a clear picture on the impact of renaming. In the example above, the impact is low, as $tag only has four references in the job. Whether it is safe to delete the selected tag. Long-running projects may contain several tags that are not used anymore; by checking for references, you can find the tags that are not used anymore, and can be safely deleted.