Skip to content

feat(extraction): add Groovy language support#664

Open
ymstar wants to merge 1 commit into
colbymchenry:mainfrom
ymstar:feat/groovy-support
Open

feat(extraction): add Groovy language support#664
ymstar wants to merge 1 commit into
colbymchenry:mainfrom
ymstar:feat/groovy-support

Conversation

@ymstar
Copy link
Copy Markdown
Contributor

@ymstar ymstar commented Jun 3, 2026

Summary

Add tree-sitter based extraction for Groovy (.groovy, .gradle, .gvy, .gy, .gsh). Supports classes, methods, def functions, interfaces, enums, imports, fields, visibility modifiers, package declarations, and bare calls (juxt_function_call).

This is a rework of #302 with improvements based on the ADDING-A-LANGUAGE.md cookbook review.

Changes

File Change
src/types.ts Add 'groovy' to LANGUAGES
src/extraction/grammars.ts WASM mapping, vendored loading, extension map, display name
src/extraction/wasm/tree-sitter-groovy.wasm Vendored grammar (extends tree-sitter-java)
src/extraction/languages/groovy.ts New LanguageExtractor (Path A, based on Java)
src/extraction/languages/index.ts Register groovyExtractor
__tests__/extraction.test.ts 11 test cases

Test coverage

  • Language detection (5 extensions)
  • Class, method, function, interface, enum extraction
  • Import extraction
  • Visibility modifiers (public/private/protected)
  • Package declarations (cross-file resolution)
  • Bare calls (println "hello" via juxt_function_call)

Known limitation

Fields declared without an explicit type (e.g. private repository) are misparsed as method_declaration by the tree-sitter grammar — typed fields (e.g. private String name) extract correctly.

Test plan

  • npx tsc --noEmit — no errors
  • npx vitest run __tests__/extraction.test.ts -t "Groovy" — 11/11 passed
  • Full extraction test suite passes

Closes #169
Relates to #648
Supersedes #302

Add tree-sitter based extraction for Groovy (.groovy, .gradle, .gvy,
.gy, .gsh). Supports classes, methods, functions, interfaces, enums,
imports, fields, visibility modifiers, package declarations, and bare
calls (juxt_function_call). Vendor tree-sitter-groovy.wasm grammar.

Known limitation: fields declared without an explicit type (e.g.
`private repository`) are misparsed as method_declaration by the
tree-sitter grammar — typed fields (e.g. `private String name`) extract
correctly.
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.

Add support for Groovy language

1 participant