Skip to content

feat: rust extractor code#6

Merged
AbianS merged 3 commits intomainfrom
feat/rust-extractor-code
Jan 31, 2026
Merged

feat: rust extractor code#6
AbianS merged 3 commits intomainfrom
feat/rust-extractor-code

Conversation

@AbianS
Copy link
Owner

@AbianS AbianS commented Jan 31, 2026

  • Implement extractRustEntities() for parsing Rust AST via tree-sitter
  • Extract structs, enums, traits, impls, functions, methods, modules, macros, and imports
  • Support generic types, visibility modifiers, async/const/unsafe function flags
  • Track line numbers and parse doc comments (/// and /** */)
  • Qualified names for methods (e.g., Calculator::add)
  • Add 12 test suites with 30+ test cases covering all entity types
  • Include unit tests for generics, docstrings, visibility, and line number tracking
  • Add CLI commands for commit, create-github-issue, and fix-github-issue

Summary by CodeRabbit

  • New Features

    • Added Rust support: parsing, symbol extraction, and analysis across the codebase.
  • Documentation

    • Added procedural guides for creating conventional commits and for creating/fixing GitHub issues via CLI.
  • Tests

    • Added extensive tests covering Rust parsing and extraction behavior.
  • Chores

    • Updated development dependencies and added a changeset noting the Rust extractor feature.

✏️ Tip: You can customize this high-level summary in your review settings.

- Implement extractRustEntities() for parsing Rust AST via tree-sitter
- Extract structs, enums, traits, impls, functions, methods, modules, macros, and imports
- Support generic types, visibility modifiers, async/const/unsafe function flags
- Track line numbers and parse doc comments (/// and /** */)
- Qualified names for methods (e.g., Calculator::add)
- Add 12 test suites with 30+ test cases covering all entity types
- Include unit tests for generics, docstrings, visibility, and line number tracking
- Add CLI commands for commit, create-github-issue, and fix-github-issue
@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Rust language support via a new tree-sitter-based Rust extractor and parser updates; adds comprehensive Rust extractor tests; introduces three Claude command docs for commit and GitHub issue workflows; and updates several dependencies and meta files.

Changes

Cohort / File(s) Summary
Rust Extractor & Types
apps/server/src/code/extractors/rust.ts, apps/server/src/code/types.ts
New Rust extractor extractRustEntities added; EntityType and AnalysisResult unions extended with Rust kinds (struct, enum, trait, impl, mod, macro) and language = rust.
Parser & Integration
apps/server/src/code/parser.ts, apps/server/src/code/index.ts
Parser updated to load and parse Rust grammar (rust accepted in loadLanguage/parseCode/detectLanguage); index routes Rust trees to the Rust extractor and updates entity type ordering.
Rust Tests
apps/server/tests/code/parser.test.ts, apps/server/tests/code/rust.test.ts
Adds parser tests for Rust detection/loading and comprehensive extractor tests validating structs, enums, traits, impls, functions/methods, modules, macros, imports, docstrings, and line numbers.
Claude Command Docs
.claude/commands/commit.md, .claude/commands/create-github-issue.md, .claude/commands/fix-github-issue.md
New documentation files describing AI-assisted commit creation (Conventional Commits), GitHub issue creation via gh CLI, and guided issue-fix workflow.
Dependency & Config Updates
apps/server/package.json, apps/tui/package.json, package.json, biome.json, .changeset/breezy-aliens-cry.md
Dependency bumps and additions: @modelcontextprotocol/sdk 1.25.2→1.25.3, added tree-sitter-rust@0.24.0, @types/bun bumped, @biomejs/biome & turbo bumped; biome schema version updated; new changeset added.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Parser as Parser
    participant Detector as LanguageDetector
    participant Loader as WASMLoader
    participant RustExt as RustExtractor
    participant Analyzer as SymbolTable

    User->>Parser: parseCode(source, language/filePath)
    Parser->>Detector: detectLanguage(filePath)
    Detector-->>Parser: "rust"
    Parser->>Loader: loadLanguage("rust")
    activate Loader
    Loader-->>Parser: rust grammar loaded
    deactivate Loader
    Parser->>Parser: parse with Rust grammar -> tree
    Parser->>RustExt: extractRustEntities(tree, source)
    activate RustExt
    RustExt->>RustExt: traverse AST (struct/enum/trait/impl/func/mod/macro/use)
    RustExt-->>Parser: codeEntities[]
    Parser-->>Analyzer: formatAnalysisResult(codeEntities)
    Analyzer-->>User: formatted analysis/result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: rust extractor code' directly describes the main feature added—a Rust code extractor. It aligns with the primary objective of implementing extractRustEntities() and Rust support throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/rust-extractor-code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AbianS AbianS merged commit 713b190 into main Jan 31, 2026
1 of 2 checks passed
@AbianS AbianS deleted the feat/rust-extractor-code branch January 31, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant