Open
Conversation
…ve test file handling - Added logic to assess coupling in C# files based on namespace and class prefix. - Updated the method for retrieving C# sibling files to use the correct file extension. - Improved test file identification by utilizing a dedicated classification function.
…alidation - Introduced new tests for identifying C# test files based on naming conventions. - Added functions to validate C# project structures and test directory components. - Enhanced existing test cases to cover various C# scenarios, improving overall test coverage.
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 C# as the 6th fully supported language in Contextception, with complete extractor, resolver, analyzer integration, and benchmark validation.
What's included
Extractor (
internal/extractor/csharp/)using,using static,using alias,global using, and file-scoped namespace declarationsExtractDefinitionsfor class, interface, struct, enum, record, method, property, const, and delegate signaturesResolver (
internal/resolver/csharp/).csproj/.shprojfilesResolveAll(C#'s implicit type visibility within namespaces)Microsoft.*/System.*projects (Roslyn, EF Core)Analyzer integration
IsCSharpSameNamespaceflag threaded through graph construction, categorization, and signal generationEFCore.Design↔EFCore.Design.Tests, Roslyn-styleCSharp↔CSharpTest, Jellyfin-style renamed projectscsharpPrefixStemMatchfor test-to-subject matching when tests use shorter CamelCase names (e.g.,AutomaticLineEnder→AutomaticLineEnderCommandHandler)likelyModifyConfidencefor class prefix match and co-change evidenceIsTestFileandhasTestDirComponentextended for C# patterns (.Tests,.Test,*Spec.cs,TestFoo.cs)Bug fixes found during review
GetCSharpSiblingsInDirpassing"csharp"instead of"cs"as the file extension parameter, which would have made same-namespace sibling discovery return zero resultsresolveSameNamespaceusing inline test detection instead ofclassify.IsTestFile(), missing*Spec.csfileslikelyModifyConfidence(Go, Java, and Rust had these but C# was omitted)Benchmarks
scripts/score_csharp.py) with ground truth validationDocumentation
Test coverage
usingvariants, block comments, definitions)csharpPrefixStemMatch,isCSharpTestProjectMirror,hasTestDirComponentC# patterns,extractTestStemC# patterns,csharpProjectInfo,IsTestFileC# patternsclassify.IsTestFileC# casesmake checkclean (vet + lint + test)