auto-indexing

Auto-indexing is the process of periodically generating code graph data for a repository within Sourcegraph itself and adding it to the Sourcegraph instance.

Roughly speaking, auto-indexing has three parts:

  1. auto-inference: This determines how to invoke the indexer in step 2.
  2. Running an indexer: This generates the code graph data.
  3. Uploading the generated code graph data.

For some repositories, depending on the programming language and build system, auto-inference may not be possible. In such situations, one can specify an auto-indexing configuration in the Sourcegraph UI, which is used to run the indexer.

Auto-indexing typically tends to work well with:

See also:

auto-inference

Auto-inference is an optional first step of [auto-indexing], which looks at a repository's contents and determines:

  1. Which indexer should be invoked (e.g. if a repository has code with .ts files, we should probably invoked our TypeScript index)
  2. How the indexers will be invoked, i.e. what environment variables and command-line arguments should be used.

build system

A tool that is used to transform code into a format where it can be executed, usually by carrying out a series of build steps (~almost always organized as a directed acylic graph), each of which invokes a more lower-level tool (such as a compiler).

A build system understands the relations between different files, [modules][#module] and [packages][#package].

In the context of code navigation, for out-of-the-box support, an indexer needs to invoke the build system in the right way. (TODO: Clarify this!)