feat: C# and Ruby parsers behind an optional cgh[langs] extra#72
Merged
Conversation
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).
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.
FEAT-13. C#/Ruby tree-sitter parsers shipped as an optional
langsextra so the core install stays lean and 3.14-safe.parsers/csharp.py(.cs) — classes/interfaces/structs/enums/records, methods + ctors,usingimports, 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— newlangsoptional group (tree-sitter-c-sharp,tree-sitter-ruby), NOT in core deps.uv.lockregenerated.parsers/__init__.py—_discover_parsersskips 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.