feat(parser): C# language pack via optional extra - #63
Merged
Conversation
graphlm[csharp] pulls tree-sitter-c-sharp; the resolver lives in-tree (graphlm/parsers/csharp.py). using static Ns.Type and using Alias = Type resolve to Ns/Type.cs. A namespace using Ns; resolves only when exactly one scanned file lives in that namespace directory — two or more files are dropped (GRAPH_DIFF fan-out, same reason as Java wildcards) and mark the list not exhaustive (ADR-007). using System; misses are third-party, not partial. Without the extra: zero C# edges, one log line, never a crash. graphlm[all] now includes csharp. Verified: csharp_project exact edge set (4 edges + cycle); pytest 732 passed / 5 skipped with extras; mypy clean. Co-authored-by: Grok 4.6 <noreply@x.ai>
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.
Summary
Adds
graphlm[csharp]— the next language pack by GitHub Octoverse popularity after the shipped Python / JS+TS / Java / Rust set.tree-sitter-c-sharp; resolver is in-tree (graphlm/parsers/csharp.py).using static Ns.Type/using Alias = Ns.Typeresolve toNs/Type.cs(thenNs.csfor a nested type).kindisstatic/import.using Ns;resolves only when exactly one scanned.cslives in that namespace directory. Two or more files are dropped (GRAPH_DIFF fan-out — same reason as Java wildcards, ADR-007) and mark the list not exhaustive.using System;and other misses are third-party, not partial.graphlm[all]now includescsharp.Why
C#
usingnames a namespace, not a file. Fan-out to every file in the namespace would churn every importer's edge set when a type is added. Unique-or-drop is the honest v1; the model still infers the rest.Verification
uv run pytest -q— 732 passed, 5 skipped (with--extra mcp --extra all)uv run mypy graphlm --ignore-missing-imports— cleantests/fixtures/csharp_project/: exact 4-edge set, User↔UserService cycle, multi-fileTooManynamespace produces no edge + partial,using System;dropped