Context
After T15 extracts a TreeSitterAnalyzer base class, adding new languages becomes a small subclass per language. This ticket adds 5 new languages (Go, Rust, TypeScript, Ruby, C++) and re-enables C (currently commented out at api/analyzers/source_analyzer.py:28). With this change the indexer covers 11 languages total: Python, JavaScript, TypeScript, Java, C#, Kotlin, Go, Rust, Ruby, C, C++.
This dramatically widens the set of repos cgraph (and the new MCP server) can usefully index.
Scope (in)
Six small subclasses of TreeSitterAnalyzer:
- Go —
api/analyzers/go/analyzer.py, deps tree-sitter-go, extension .go
- Rust —
api/analyzers/rust/analyzer.py, deps tree-sitter-rust, extension .rs
- TypeScript —
api/analyzers/typescript/analyzer.py, deps tree-sitter-typescript, extensions .ts and .tsx
- Ruby —
api/analyzers/ruby/analyzer.py, deps tree-sitter-ruby, extension .rb
- C++ —
api/analyzers/cpp/analyzer.py, deps tree-sitter-cpp, extensions .cc, .cpp, .cxx, .hpp, .hh
- C (re-enable) — uncomment and fix any rot in
api/analyzers/c/analyzer.py; ensure it uses the new base class from T15
Each subclass:
- Declares its tree-sitter
Language instance, node-type-to-label map, query templates, and file extensions.
- Registers itself in
api/analyzers/source_analyzer.py's extension dispatch dict.
Per-language test fixtures in tests/analyzers/fixtures/<lang>/ with a small known call graph and assertion contract (similar to T3 but per language).
Scope (out)
- Replacing the LSP-based Java/C# analyzers with tree-sitter (these stay on multilspy).
- Languages beyond the 6 listed (Swift, PHP, Scala, etc. — Phase 2).
- Cross-language call resolution (e.g. JS calling a TS function).
Files
- new
api/analyzers/go/analyzer.py
- new
api/analyzers/rust/analyzer.py
- new
api/analyzers/typescript/analyzer.py
- new
api/analyzers/ruby/analyzer.py
- new
api/analyzers/cpp/analyzer.py
- modified
api/analyzers/c/analyzer.py (re-enable, port to base class)
- modified
api/analyzers/source_analyzer.py (register new extensions; uncomment C)
- modified
pyproject.toml (add tree-sitter-go, tree-sitter-rust, tree-sitter-typescript, tree-sitter-ruby, tree-sitter-cpp; check existing tree-sitter-c version)
- new
tests/analyzers/fixtures/go/, rust/, typescript/, ruby/, cpp/, c/
- new
tests/analyzers/test_new_languages.py
- modified
README.md (Supported languages section)
Acceptance criteria
Dependencies
Notes for the implementer
- Per-language fixtures should be tiny — 3-4 files with a known
entrypoint → service → repo call chain is enough. Don't pull in real-world projects.
- Tree-sitter grammar packages are pre-built wheels for most platforms. Verify the CI matrix can install all 5 new ones.
- When re-enabling C, find out why it was commented out — look at git blame on
source_analyzer.py:28. If there's a known bug, fix it before re-enabling.
- TypeScript shares much of its grammar with JavaScript. Be careful that
.ts files don't get routed to the JS analyzer by accident.
Context
After T15 extracts a
TreeSitterAnalyzerbase class, adding new languages becomes a small subclass per language. This ticket adds 5 new languages (Go, Rust, TypeScript, Ruby, C++) and re-enables C (currently commented out atapi/analyzers/source_analyzer.py:28). With this change the indexer covers 11 languages total: Python, JavaScript, TypeScript, Java, C#, Kotlin, Go, Rust, Ruby, C, C++.This dramatically widens the set of repos
cgraph(and the new MCP server) can usefully index.Scope (in)
Six small subclasses of
TreeSitterAnalyzer:api/analyzers/go/analyzer.py, depstree-sitter-go, extension.goapi/analyzers/rust/analyzer.py, depstree-sitter-rust, extension.rsapi/analyzers/typescript/analyzer.py, depstree-sitter-typescript, extensions.tsand.tsxapi/analyzers/ruby/analyzer.py, depstree-sitter-ruby, extension.rbapi/analyzers/cpp/analyzer.py, depstree-sitter-cpp, extensions.cc,.cpp,.cxx,.hpp,.hhapi/analyzers/c/analyzer.py; ensure it uses the new base class from T15Each subclass:
Languageinstance, node-type-to-label map, query templates, and file extensions.api/analyzers/source_analyzer.py's extension dispatch dict.Per-language test fixtures in
tests/analyzers/fixtures/<lang>/with a small known call graph and assertion contract (similar to T3 but per language).Scope (out)
Files
api/analyzers/go/analyzer.pyapi/analyzers/rust/analyzer.pyapi/analyzers/typescript/analyzer.pyapi/analyzers/ruby/analyzer.pyapi/analyzers/cpp/analyzer.pyapi/analyzers/c/analyzer.py(re-enable, port to base class)api/analyzers/source_analyzer.py(register new extensions; uncomment C)pyproject.toml(addtree-sitter-go,tree-sitter-rust,tree-sitter-typescript,tree-sitter-ruby,tree-sitter-cpp; check existingtree-sitter-cversion)tests/analyzers/fixtures/go/,rust/,typescript/,ruby/,cpp/,c/tests/analyzers/test_new_languages.pyREADME.md(Supported languages section)Acceptance criteria
source_analyzer.py's extension dispatch.make lintandmake testclean.pyproject.tomldeclares all new tree-sitter grammar deps with sane version pins.Dependencies
Notes for the implementer
entrypoint → service → repocall chain is enough. Don't pull in real-world projects.source_analyzer.py:28. If there's a known bug, fix it before re-enabling..tsfiles don't get routed to the JS analyzer by accident.