Skip to main content

Module builder

Module builder 

Source
Expand description

Graph builder trait.

Language integrations implement this trait to populate the unified CodeGraph using tree-sitter ASTs. Builders operate on mutable references to StagingGraph buffers, which are per-file and can be built in parallel without synchronisation. After building, staging buffers are merged into the main graph.

§Architecture

The build pipeline uses a transactional staging pattern:

  1. Each file gets its own StagingGraph (thread-local)
  2. Builders populate the staging buffer via mutable reference
  3. After all files are processed, staging buffers are committed atomically

This enables parallel builds while maintaining correctness guarantees.

Traits§

GraphBuilder
Trait implemented by all language-specific graph builders.