Code navigation
Navigate your code with tooling that understands it

Code navigation enables developers to explore code by
- jumping to definitions
- finding references
- listing implementations
- browsing symbols defined in current document or folder
- navigate dependencies
- documentation in hover tooltips
Code navigation is made up of multiple features that build on top of each other:
Search-based code navigation works out of the box with all of the most popular programming languages, powered by Sourcegraph’s code search.
Precise code navigation uses code graph data to provide precise code navigation features and accurate cross-repository navigation. We currently have precise support the languages below. See the indexers page for a detailed breakdown of each indexer’s status.
Language Indexer Status Go lsif-go 🟢 GA TypeScript/JavaScript scip-typescript 🟢 GA C/C++ lsif-clang 🟡 Partially available Java scip-java 🟢 GA Scala scip-java 🟢 GA Kotlin scip-java 🟢 GA Rust rust-analyzer 🟢 GA Python scip-python 🟢 GA Ruby scip-ruby 🟡 Partially available Auto-indexing uses Sourcegraph executors to create indexes for the code in your Sourcegraph instance, giving you up-to-date cross-repository code navigation.
Beta Dependency navigation allows you to navigate and search through the dependencies of your code, by leveraging precise code navigation and auto-indexing.
Code navigation for your code
Here’s how you go from search-based code navigation to automatically-updating, precise code navigation across multiple repositories and dependencies:
Navigate code with search-based code navigation and Sourcegraph extensions.
Included in a standard Sourcegraph installation and works out of the box on the instances connected to the Internet. To see how to enable code navigation on the air-gapped instances please check this guide.
Start using precise code navigation by creating an index of a repository and uploading it to your Sourcegraph instance:
Optional: automate the uploading of indexes by adding indexing and uploading to your CI setup.
Get automatic precise code navigation by enabling auto-indexing which makes Sourcegraph automatically index the your repositories and enable precise code navigation for them.
Setup auto-dependency indexing to navigate and search through the dependencies used by your code:
- Go: Enable auto-indexing and Sourcegraph will start indexing your dependencies.
- JavaScript, TypeScript: Enable auto-indexing and setup a npm dependencies code host.
- Java, Scala, Kotlin: Enable auto-indexing and setup a JVM dependencies code host.
Once setup, code navigation is available for use across popular development tools:
- In the Sourcegraph web UI
- When browsing code on your code host, via integrations
- While looking at diffs in your code review tool, via integrations
- In the Sourcegraph API
Explanations
- Introduction to code navigation
- Precise code navigation
- Search-based code navigation
- Code navigation features
- Beta Rockskip: faster search-based code navigation
- Writing an indexer
- Auto-indexing
- Auto-indexing inference
How-tos
General
Language-specific guides
Automate uploading code graph data