Skip to content

feat: C# and Ruby parsers behind an optional cgh[langs] extra#72

Merged
joy-software merged 1 commit into
developfrom
feat/langs-csharp-ruby
Jun 7, 2026
Merged

feat: C# and Ruby parsers behind an optional cgh[langs] extra#72
joy-software merged 1 commit into
developfrom
feat/langs-csharp-ruby

Conversation

@joy-software

Copy link
Copy Markdown
Contributor

FEAT-13. C#/Ruby tree-sitter parsers shipped as an optional langs extra so the core install stays lean and 3.14-safe.

  • parsers/csharp.py (.cs) — classes/interfaces/structs/enums/records, methods + ctors, using imports, invocation/object-creation calls; handles block + file-scoped namespaces.
  • parsers/ruby.py (.rb) — classes/modules, def / def self. methods, require/require_relative/load imports, calls.
  • pyproject.toml — new langs optional group (tree-sitter-c-sharp, tree-sitter-ruby), NOT in core deps. uv.lock regenerated.
  • parsers/__init__.py_discover_parsers skips an optional-grammar module (csharp/ruby) on ImportError; any other import error still surfaces. Core works unchanged when the extra is absent.

Both grammars verified to install on Python 3.13 and 3.14. Tests are importorskip-guarded (skip without the extra), and ran (not skipped) with it installed: tests/test_parsers + tests/test_indexer = 195 passed.

Ship .cs and .rb parsers behind a new `langs` optional extra
(tree-sitter-c-sharp, tree-sitter-ruby), kept out of the core deps so
the base install stays lean and 3.14-safe.

- csharp.py: classes/interfaces/structs/enums/records, methods and
  constructors, using directives as imports, invocation and object
  creation as calls. Handles block and file-scoped namespaces.
- ruby.py: classes and modules, def and def self. methods, require /
  require_relative as imports, method calls.
- _discover_parsers now skips an optional-grammar module when its
  grammar package is absent, so cgh behaves exactly as before when the
  extra is not installed. Real import errors in hard-dep parsers still
  propagate.
- Tests guarded with importorskip so they skip without the extra; with
  it installed they run (195 passed across test_parsers + test_indexer).
@joy-software joy-software merged commit d4aa130 into develop Jun 7, 2026
8 checks passed
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