feat(#678): migrate C++ indexing to Rust-owned engine - #687
Merged
Conversation
C++ files now route to the Rust core engine instead of the TypeScript-owned tree-sitter extractor. This completes the Rust-owned language migration roadmap for C/C++. Changes: - Rust core: expand resolve_same_file_exact_callable_refs language filter to include c | cpp (was JS/TS-only) - TS shell: add 'cpp' to RUST_HYBRID_RUST_OWNED_LANGUAGES - Remove TS-owned C++ extractor (src/extraction/languages/c-cpp.ts) - Remove cpp grammar from WASM_GRAMMAR_FILES and auto-load logic - Remove 'cpp' from STATIC_MEMBER_LANGS - Update .h boundary test: widget.h now routes to Rust (was TS fallback) - Add C++ language smoke test (symbols, call edges, hybrid metadata) - Update README language support table (C++ → Rust-owned) - Fix dead links to c-cpp.ts in SEARCH_QUALITY_LOOP.md - Add fmtlib/fmt corpus validation evidence (71 files, 500 nodes) - Add #678 closeout section to plan-artifact-consolidated-closeout.md - Update CHANGELOG.md Validation: - cargo test: 6/6 passing - fmtlib/fmt corpus: 71 files indexed, 500 C++ nodes, healthy fallback - No TS fallback for C++ files
C++ is now fully Rust-owned and no longer needs a tree-sitter WASM grammar entry. However, removing cpp from WASM_GRAMMAR_FILES broke the Record<GrammarLanguage, string> type constraint because GrammarLanguage still included 'cpp'. Changes to src/extraction/grammars.ts: - Exclude 'cpp' from GrammarLanguage type (no WASM grammar needed) - Add 'cpp' to isLanguageSupported() returning true (Rust-owned, prevents files from being marked unsupported and skipped before reaching rust-hybrid routing) - Add 'cpp' to getSupportedLanguages() return array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates C++ indexing from the TypeScript-owned tree-sitter extractor to the Rust core engine, completing the Rust-owned language migration roadmap for C/C++ (Issue #678).
Changes
Rust Core (
crates/zcodegraph-core/src/lib.rs)resolve_same_file_exact_callable_refslanguage filter to includec | cpp(was JS/TS-only) — this was the root cause of 0 call edges for C++ filesTypeScript Shell
src/indexing/rust-hybrid-contract.ts: Added'cpp'toRUST_HYBRID_RUST_OWNED_LANGUAGES— C++ files now route to Rust enginesrc/extraction/languages/index.ts: Removedimport { cppExtractor }andcpp: cppExtractorfrom extractor mapsrc/extraction/grammars.ts: Removedcpp: 'tree-sitter-cpp.wasm'fromWASM_GRAMMAR_FILESsrc/extraction/index.ts+src/extraction/index-stages.ts+src/index.ts: Removed 4neededLanguages.push('cpp')auto-load blockssrc/extraction/tree-sitter.ts: Removed'cpp'fromSTATIC_MEMBER_LANGSsrc/extraction/languages/c-cpp.ts: Deleted — TS-owned C++ extractor fully replaced by Rust coreTests
__tests__/rust-index-engine-cli-fallback.test.ts:.hboundary test —widget.hnow routes to Rust (was TS fallback),engineByLanguagechanged from{ cpp: 'typescript' }to{ cpp: 'rust' }__tests__/rust-index-engine-cli-language-smoke.test.ts: Added C++ smoke test verifying symbols (Widget class, app namespace, main function, imports) and call edges (main → render) and hybrid metadata (cpp: 'rust')Documentation
README.md: Language support table — C++ moved from TS-indexed to Rust-owneddocs/SEARCH_QUALITY_LOOP.md: Fixed dead links toc-cpp.ts→ Rust core pathsdocs/designs/plan-artifact-consolidated-closeout.md: Added PRD: Migrate C++ baseline extraction to Rust-owned indexing #678 closeout section with durable decisionsdocs/benchmarks/2026-07-13-rust-owned-cpp-fmt-validation.md: fmtlib/fmt corpus validation evidence (71 files, 500 nodes, healthy fallback)CHANGELOG.md: Added Unreleased entryValidation
fallbackState=healthy, zero TS fallbackCloses #678