Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 7.02 KB

File metadata and controls

93 lines (73 loc) · 7.02 KB

Precise Code Navigation

Supported on [Enterprise](/pricing/plans/enterprise) plans. Available via the Web app.

Learn and understand about Precise Code Navigation.

Precise Code Navigation is an opt-in feature that is enabled from your admin settings and requires you to upload indexes for each repository to your Sourcegraph instance. Once setup is complete on Sourcegraph, precise code navigation is available for use across popular development tools:

  • On the Sourcegraph web UI
  • On code files on your code host, via integrations
  • On diffs in your code review tool, via integrations
  • Via the Sourcegraph API

Sourcegraph automatically uses Precise Code Navigation whenever available, and Search-based Code Navigation is used as a fallback when precise navigation is not available.

Precise code navigation relies on the open source SCIP Code Intelligence Protocol, which is a language-agnostic protocol for indexing source code.

Setting up code navigation for your codebase

Auto-indexing is a fast way to get started, but for complex or authenticated builds we recommend [running SCIP indexing in your CI pipeline](/code-navigation/how-to/adding-scip-to-workflows). This reuses your existing build configuration and secrets, delivering more reliable, repeatable precise code navigation. For best results, verify the indexer runs successfully on your machine first, then add it as a CI job.
  1. Manual indexing. Index a repository and upload it to your Sourcegraph instance:

  2. Automate indexing via CI: Add indexing and uploading to your CI setup.

  3. Auto-indexing: Sourcegraph will automatically index your repositories and enable precise code navigation for them.

Supported languages and indexers

Precise Code Navigation requires language-specific indexes to be generated and uploaded to your Sourcegraph instance. We currently have precise code navigation support for the languages below. See the indexers page for a detailed breakdown of each indexer's status.

Language Indexer Status
Go scip-go 🟢 Generally available
TypeScript, JavaScript scip-typescript 🟢 Generally available
C, C++, CUDA scip-clang 🟢 Generally available
Java, Kotlin, Scala scip-java 🟢 Generally available
Rust rust-analyzer 🟢 Generally available
Python scip-python 🟢 Generally available
Ruby scip-ruby 🟢 Generally available
C#, Visual Basic scip-dotnet 🟢 Generally available

The easiest way to configure precise code navigation is with auto-indexing. This feature uses Sourcegraph executors to automatically create indexes for the code, keeping precise code navigation available and up-to-date.

Precise navigation examples

The following repositories have precise code navigation enabled:

Programming Language Repo
Go kubernetes/kubernetes
Java google/guava
Scala apache/pekko
Python Textualize/rich
TypeScript vuejs/core
Rust serde-rs/serde
Ruby Homebrew/brew
C++ fmtlib/fmt
C# serilog/serilog

More resources