Search documentation...Ctrl K
API Reference

Supported Languages

OmniContext provides full AST parsing support for 13+ programming languages using tree-sitter grammars. Each language includes symbol extraction, import resolution for dependency graphs, visibility inference, and documentation extraction.


Language Support Matrix

Languagetree-sitter GrammarAST ExtractorGraph ResolverTestsStatus
Pythontree-sitter-pythonCore Baseline
TypeScripttree-sitter-typescriptCore Baseline
JavaScripttree-sitter-javascriptCore Baseline
Rusttree-sitter-rustCore Baseline
Gotree-sitter-goCore Baseline
Javatree-sitter-javaExtended
Ctree-sitter-cExtended
C++tree-sitter-cppExtended
C#tree-sitter-c-sharpExtended
CSStree-sitter-cssExtended
Rubytree-sitter-rubyPending Baseline
PHPtree-sitter-phpPending Baseline
Swifttree-sitter-swiftPending Baseline
Kotlintree-sitter-kotlin-ngPending Baseline

Status meanings:

  • Core Baseline — full support, thoroughly tested, production-ready.
  • Extended — full support, tested, actively maintained.
  • Pending Baseline — functional, test suite being expanded.

Language Capabilities

1. AST Structural Mapping

Each language parser maps tree-sitter nodes to OmniContext's internal chunk representation. The following symbol kinds are extracted:

KindDescription
functionFunction declarations and definitions
classClass declarations
traitTrait and interface definitions
implImplementation blocks (Rust)
constConstants and static values
typeType aliases and definitions
moduleModule and namespace declarations
testTest functions and test blocks

2. Graph Import Resolution

OmniContext builds a dependency graph by resolving language-specific import statements at index time:

LanguageResolved Constructs
Pythonimport, from ... import, importlib
TypeScript / JavaScriptimport, require(), barrel re-exports (export * from)
Rustuse, mod, pub use
Goimport
Javaimport, package
C / C++#include
C#using

3. Visibility Inference

Search results and dependency graphs respect language-specific visibility rules:

LanguageVisibility Mechanism
PythonHeuristic: names without a leading _ are treated as public
TypeScript / JavaScriptStatic: presence of export token
RustExplicit: pub, pub(crate), pub(super)
GoSyntactic: capitalized identifiers are public
JavaKeywords: public, private, protected, package-private
C#Keywords: public, private, internal, protected

4. Documentation Extraction

OmniContext extracts documentation comments and makes them searchable alongside symbol names:

LanguageComment Format
Python"""docstring"""
TypeScript / JavaScript/** JSDoc */
Rust/// doc comment and //! inner doc comment
Go// Package / function comment (preceding the declaration)
Java/** Javadoc */
C#/// <summary>XML doc comment</summary>

Adding New Languages

To add support for a new language, follow the workflow defined in .agents/workflows/add-language.md. The average integration time is approximately 3 engineering days.

Required steps:

  1. Add the tree-sitter grammar crate to Cargo.toml in crates/omni-core.
  2. Implement the LanguageParser trait in crates/omni-core/src/parser/languages/.
  3. Add graph import resolution logic.
  4. Register the language in crates/omni-core/src/parser/registry.rs.
  5. Create unit test fixtures in crates/omni-core/tests/.
  6. Submit a pull request with the new language and test fixtures.

Performance

All language parsers are designed to maintain consistent throughput:

MetricTarget
File parsing> 500 files / second
AST extraction< 5 ms per file
Graph resolution< 10 ms per file
Chunk memory overhead< 2 KB per indexed chunk

These figures are measured on modern commodity hardware (8-core CPU, NVMe storage) using the core baseline languages.