[http-client-csharp] Consolidate duplicate MethodSignature comparison logic#9692
Merged
JonathanCrd merged 5 commits intomicrosoft:mainfrom Feb 14, 2026
Merged
Conversation
Contributor
|
No changes needing a change description found. |
Contributor
jorgerangel-msft
left a comment
There was a problem hiding this comment.
Can we please add a few unit tests exercising the new comparer?
.../http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/MethodSignature.cs
Show resolved
Hide resolved
...p-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/MethodSignatureBase.cs
Outdated
Show resolved
Hide resolved
...ages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs
Outdated
Show resolved
Hide resolved
Contributor
|
Can we verify the fix in Search before merging? |
...p-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/MethodSignatureBase.cs
Show resolved
Hide resolved
…thanCrd/typespec into bug-IsMatch-MethodSignature
JoshLove-msft
approved these changes
Feb 14, 2026
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.
Fixes #9658
This PR removes duplicated method signature comparison logic by using a consolidated
MethodSignatureEqualityComparerUsed AI to generate the following text based on the commit history
Changes
🔧 Created Unified Comparer
MethodSignatureBaseEqualityComparertoMethodSignatureBaseclasspublic static readonly IEqualityComparer<MethodSignatureBase> SignatureComparer🧹 Eliminated Duplication in TypeProvider
IsMatch()logic with single line delegation to base comparerIsNameMatch,GetFullMethodName)🚀 Simplified MethodSignature Comparer
MethodSignatureEqualityComparerwrapper classMethodSignatureComparer => SignatureComparer📝 Updated References
ClientProvider.csandModelFactoryProvider.csto maintain existing APIBenefits
✅ Single source of truth - All method signature equality logic unified
✅ Extended to constructors - Base comparer now works for both methods and constructors
✅ Eliminated ~50 lines of duplicate code
✅ Backward compatible - No breaking changes to existing APIs
✅ All tests pass - Verified with full test suite (3,235 tests, 0 failures)
Testing