Skip to content

Conversation

@GhostTypes
Copy link
Collaborator

This commit expands AST language support by integrating ast-grep language packages:

  • @ast-grep/lang-typescript (v0.0.4) - Enhanced TypeScript support
  • @ast-grep/lang-tsx (v0.0.4) - Enhanced TSX support
  • @ast-grep/lang-rust (v0.0.4) - New Rust language support

Changes:

  • Added three language packages to dependencies
  • Updated ASTLanguage type to include 'rust'
  • Implemented dynamic language registration using registerDynamicLanguage()
  • Added .rs file extension mapping for Rust
  • Updated isAvailable() to verify all language packages load correctly
  • Added comprehensive Rust test cases (functions, structs, impl blocks, async)
  • Created test fixtures with Rust code samples

All 24 AST integration tests pass, including 4 new Rust-specific tests. Users can now perform structural code search on Rust codebases without any additional configuration.

This commit expands AST language support by integrating ast-grep language packages:
- @ast-grep/lang-typescript (v0.0.4) - Enhanced TypeScript support
- @ast-grep/lang-tsx (v0.0.4) - Enhanced TSX support
- @ast-grep/lang-rust (v0.0.4) - New Rust language support

Changes:
- Added three language packages to dependencies
- Updated ASTLanguage type to include 'rust'
- Implemented dynamic language registration using registerDynamicLanguage()
- Added .rs file extension mapping for Rust
- Updated isAvailable() to verify all language packages load correctly
- Added comprehensive Rust test cases (functions, structs, impl blocks, async)
- Created test fixtures with Rust code samples

All 24 AST integration tests pass, including 4 new Rust-specific tests.
Users can now perform structural code search on Rust codebases without
any additional configuration.
@GhostTypes GhostTypes self-assigned this Nov 22, 2025
GhostTypes and others added 9 commits November 22, 2025 03:04
Expanded AST search to support all major programming languages matching
the project's stack detection capabilities. Added 12 new language packages
to the existing 3 (TypeScript, TSX, Rust).

New language packages added:
- @ast-grep/lang-bash (v0.0.4) - Shell scripts
- @ast-grep/lang-c (v0.0.3) - C language
- @ast-grep/lang-cpp (v0.0.3) - C++ language
- @ast-grep/lang-csharp (v0.0.3) - C#/.NET
- @ast-grep/lang-go (v0.0.3) - Go language
- @ast-grep/lang-java (v0.0.4) - Java language
- @ast-grep/lang-json (v0.0.4) - JSON files
- @ast-grep/lang-kotlin (v0.0.4) - Kotlin language
- @ast-grep/lang-python (v0.0.3) - Python language
- @ast-grep/lang-scala (v0.0.4) - Scala language
- @ast-grep/lang-swift (v0.0.5) - Swift language
- @ast-grep/lang-yaml (v0.0.3) - YAML files

Changes:
- Updated ASTLanguage type to include all 15 supported languages
- Registered all dynamic languages in ensureLanguagesRegistered()
- Added comprehensive file extension mappings (33 extensions total)
- Updated isAvailable() to report all supported languages dynamically
- Fixed ast-mcp-integration.test.ts to check for 'bundled' and 'languages'
  instead of exact string match (more flexible for future additions)

New test coverage:
- Added Python test fixtures (classes, functions, async, decorators)
- Added Go test fixtures (structs, methods, functions, interfaces)
- Added Java test fixtures (classes, methods, interfaces, static methods)
- Added 9 new test cases covering Python, Go, and Java patterns
- Total test cases now: 37 (up from 24)

All languages are bundled and work out-of-the-box without user configuration.
Supports: bash, c, cpp, csharp, css, go, html, java, javascript, json,
kotlin, python, rust, scala, swift, tsx, typescript, yaml.
Achieved complete test coverage for all 15 supported languages with
comprehensive integration tests. All tests passing!

New test fixtures added for:
- C (structs, functions, declarations)
- C++ (classes, templates, namespaces)
- C# (classes, interfaces, static methods, properties)
- Kotlin (data classes, functions, objects, extension functions)
- Scala (case classes, traits, objects, functions)
- Swift (structs, classes, protocols, extensions)
- Bash (functions, conditionals, case statements)
- JSON (properties, objects, arrays)
- YAML (keys, nested objects, arrays)

Test Statistics:
- 60 total tests (up from 37)
- 14 dedicated language test suites
- 3 tests per new language (min)
- JavaScript/HTML/CSS: covered by existing tests
- All 15 languages: 100% coverage ✅

Test Results:
- All 60 tests passing
- Verified stable across 3 consecutive runs
- Production ready!

Languages tested:
bash, c, cpp, csharp, css, go, html, java, javascript, json,
kotlin, python, rust, scala, swift, tsx, typescript, yaml
- Document all 15 supported AST languages in detailed table
- Add file extension mappings for each language
- Update overview to highlight AST support for 15 languages
- Clarify that all language packages are bundled (no installation needed)
- Maintain clean centered styling throughout
@GhostTypes GhostTypes merged commit fd5a9af into main Nov 22, 2025
3 checks passed
@GhostTypes GhostTypes deleted the claude/add-ast-language-support-01CCLFej5mKF4R6sXmMbBxD9 branch November 22, 2025 20:39
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.

3 participants