Navigating code on GitHub

You can understand the relationships within and across repositories by navigating code directly in GitHub.

About navigating code on GitHub

Code navigation uses the open source library tree-sitter. The following languages are supported:

  • C#
  • CodeQL
  • Go
  • Java
  • JavaScript
  • PHP
  • Python
  • Ruby
  • TypeScript

Jumping to the definition of a function or method

You can jump to a function or method's definition within the same repository by clicking the function or method call in a file.

Jump-to-definition tab

Finding all references of a function or method

You can find all references for a function or method within the same repository by clicking the function or method call in a file, then clicking the References tab.

Find all references tab

Troubleshooting code navigation

If code navigation is enabled for you but you don't see links to the definitions of functions and methods:

  • Code navigation only works for active branches. Push to the branch and try again.
  • Code navigation only works for repositories with less than 100,000 files.

Further reading

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.