Working with cross-references

Cross-references allow you to explore connections between symbols in the code base.

Where configured, cross references are supplied by kythe. To determine if a particular repository has cross references configured, look at the cross-references column on the project page. If there is a checkmark, there are cross-references for at least one language in that repository. Note that not all repositories with checkmarks have cross-references for the same set of languages.

An example of how a repository with cross references available is displayed on the project page

Jumping to a definition

Where cross-references are enabled, symbols become links. Clicking a symbol usage navigates to the place in the code where the symbol is defined. See Cross-reference settings for information on enabling underlining for clickable symbols.

Finding usages and using the cross-references panel

Clicking the place where a symbol is defined opens the cross-reference panel that shows you a list of places where the symbol is used. Clicking a reference jumps to that usage by opening a preview panel or by showing the usage in the main window. See Cross-reference settings for information on toggling this behavior. When a link in the cross-reference panel is clicked, the code browser jumps to the version of the file at which cross-references were built.

Using the call hierarchy

The call hierarchy section of the cross reference panel allows you to explore the context of references. In the call hierarchy section, clicking the twistie next to the line number shows you the caller of that reference. This allows you to explore the call hierarchy upward.

Viewing generated files

In repositories with cross-references, you can see artifacts generated from the build that are not present in the repository; for example, .cc and .h files created from proto files. Some files downloaded as part of the build process are also visible.

Some links from the cross-references panel take you into generated files. You can navigate to these generated files from the directory panel view.

Cross-reference settings

You can toggle the cross-references preview window. When the preview panel is on, clicking in the cross-reference panel opens a preview of the file next to the cross reference panel. When the preview panel is off, clicking in the cross-reference panel opens the reference in the main code window.

You can also turn underlining of cross references on and off.

How to toggle preview