C# language adapter: Roslyn token-stream hashing + dotnet test runner - #95
Merged
Conversation
…, dotnet test runner - .cs routes to CSharpAdapter; hash helper compiled once per SDK version with the SDK's bundled Roslyn (no packages, no network), cached in the user cache dir keyed by SDK version + helper source - dotnet test with the VSTest FullyQualifiedName~ filter (xUnit/NUnit/ MSTest); file-stem class convention, Outer+Inner nested spelling - identity: dotnet <sdk-version> + deps suffix over packages.lock.json / Directory.Packages.props - LanguageAdapter contract: .cs added to the routing invariant, status confirmed -> inferred pending review (hash unchanged: invariants are hash-free) - CI installs the .NET 9 SDK; ISSUES.md #23 files the example-project and NUnit/MSTest/MTP live-coverage follow-ups
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.
What
Adds C# as the fifth language adapter behind the
LanguageAdapterseam:.csimpls now hash and verify like Go/TS/Java ones.cshash/CsHash.csis compiled once per SDK version with the .NET SDK's owncsc.dllagainst its own bundledMicrosoft.CodeAnalysis*assemblies — no NuGet package, no network (the SDK has no single-file source launcher pre-.NET 10, so the cached one-time compile stands in for Java's). The hash is the definition's trivia-free, length-prefixed, CRLF-normalised token stream: formatting/comment/XML-doc edits never move it, signature/body changes always do. Qualnames match the Java grammar (Type,Type.Member,Outer.Inner.Member,Type.Typefor ctors; overloads hash together).dotnet teston the root project/solution with the VSTestFullyQualifiedName~contains-filter (xUnit, NUnit, MSTest all ride it). Node ids read like Java's:tests/CalcTests.cs::TotalSums, class from the file stem, nested classes in the runtimeOuter+Innerspelling. Summaries capped at 40 tokens; build errors aretests_failed_to_run, never a stack trace.dotnet <sdk-version>+ deps suffix overpackages.lock.json/Directory.Packages.props; config key{"dotnet": "..."}.Contract
LanguageAdapter's routing invariant now names.cs; agent-derived, so status wentconfirmed → inferred— flip on review (hashloom statuslists it). Contract hash unchanged (invariant edits are hash-free, #19), so nothing invalidated.hashloom verify --radius LanguageAdapter→ok: true.DoD
uv run pytest: 277 passed, coverage 87.4% (floor 85) — 18 new tests incl. a real xUnit e2e throughapi.verify(pass → cached-pass, fail summary, build error), plus a fresh-cache recompile test so the csc-compile path is covered regardless of cache statebench/benchmark.py: 5.4x (≥5x)Follow-ups filed as ISSUES.md #23:
examples/csharp-*project, live NUnit/MSTest fixtures, xunit-v3/MTP output parsing.🤖 Generated with Claude Code