refactor: split ISymbolExtensions into general and Moq-specific files#1037
refactor: split ISymbolExtensions into general and Moq-specific files#1037
Conversation
…#979) Separate Moq-specific symbol detection methods from general-purpose Roslyn symbol utilities to improve cohesion and discoverability. Moved to MoqSymbolExtensions.cs: - All IsMoq* methods (Setup, Verify, Returns, Throws, Callback, Raises) - IsTaskOrValueTaskType, IsTaskOrValueResultProperty (depend on MoqKnownSymbols) - IsGenericResultProperty and all Raises private helpers Kept in ISymbolExtensions.cs: - IsConstructor, IsInstanceOf (3 overloads), IsOverridable No call-site changes needed. Extension methods resolve by namespace, and all consumers already import Moq.Analyzers.Common. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the symbol extension methods by separating general Roslyn utilities from Moq-specific functionalities. This improves the modularity and maintainability of the codebase by ensuring that files contain only related logic, making it easier to understand and manage dependencies. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR splits Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| C# | Mar 8, 2026 5:43p.m. | Review ↗ |
There was a problem hiding this comment.
Code Review
This pull request effectively refactors the large ISymbolExtensions.cs file by separating general-purpose Roslyn extension methods from Moq-specific ones into a new MoqSymbolExtensions.cs file. This is a good improvement for code organization and maintainability. The approach of keeping the same namespace to avoid call-site changes is clever. The implementation is a clean move of the existing code. The minor suggestion to improve readability in the new file has been retained as it does not conflict with any established rules.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Make ISymbolExtensions a partial class so it can span multiple files. Rename MoqSymbolExtensions.cs to ISymbolExtensions.Moq.cs following the C# convention of ClassName.Purpose.cs for partial class files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#1037) ## Summary Resolves #979. Splits `ISymbolExtensions.cs` (362 lines) into two cohesive files: - **`ISymbolExtensions.cs`** (~105 lines) retains general-purpose Roslyn symbol utilities with zero Moq dependencies: `IsConstructor`, `IsInstanceOf` (3 overloads), `IsOverridable` - **`MoqSymbolExtensions.cs`** (~250 lines) contains all Moq-specific detection methods that depend on `MoqKnownSymbols` ### Methods moved to `MoqSymbolExtensions.cs` - `IsMoqSetupMethod`, `IsMoqSetupAddMethod`, `IsMoqSetupRemoveMethod`, `IsMoqEventSetupMethod`, `IsMoqSetupSequenceMethod` - `IsMoqVerificationMethod` - `IsMoqReturnsMethod`, `IsMoqThrowsMethod`, `IsMoqReturnsAsyncMethod`, `IsMoqThrowsAsyncMethod`, `IsMoqReturnValueSpecificationMethod` - `IsMoqCallbackMethod`, `IsMoqRaisesMethod` - `IsTaskOrValueTaskType`, `IsTaskOrValueResultProperty` (both accept `MoqKnownSymbols`, per code review feedback) - Private helpers: `IsSetupRaisesMethod`, `IsConcreteSetupPhraseRaisesMethod`, `IsCallbackRaisesMethod`, `IsReturnsRaisesMethod`, `IsRaiseableMethod`, `IsGenericResultProperty` ### Why no call-site changes Extension methods resolve by namespace, not class name. All consumers already import `Moq.Analyzers.Common` via `GlobalUsings.cs`. ## Test plan - [x] `dotnet build` passes with 0 errors, 0 warnings - [x] `dotnet test` passes all 2901 tests with 0 failures 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Richard Murillo <rjmurillo@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Resolves #979. Splits
ISymbolExtensions.cs(362 lines) into two cohesive files:ISymbolExtensions.cs(~105 lines) retains general-purpose Roslyn symbol utilities with zero Moq dependencies:IsConstructor,IsInstanceOf(3 overloads),IsOverridableMoqSymbolExtensions.cs(~250 lines) contains all Moq-specific detection methods that depend onMoqKnownSymbolsMethods moved to
MoqSymbolExtensions.csIsMoqSetupMethod,IsMoqSetupAddMethod,IsMoqSetupRemoveMethod,IsMoqEventSetupMethod,IsMoqSetupSequenceMethodIsMoqVerificationMethodIsMoqReturnsMethod,IsMoqThrowsMethod,IsMoqReturnsAsyncMethod,IsMoqThrowsAsyncMethod,IsMoqReturnValueSpecificationMethodIsMoqCallbackMethod,IsMoqRaisesMethodIsTaskOrValueTaskType,IsTaskOrValueResultProperty(both acceptMoqKnownSymbols, per code review feedback)IsSetupRaisesMethod,IsConcreteSetupPhraseRaisesMethod,IsCallbackRaisesMethod,IsReturnsRaisesMethod,IsRaiseableMethod,IsGenericResultPropertyWhy no call-site changes
Extension methods resolve by namespace, not class name. All consumers already import
Moq.Analyzers.CommonviaGlobalUsings.cs.Test plan
dotnet buildpasses with 0 errors, 0 warningsdotnet testpasses all 2901 tests with 0 failures🤖 Generated with Claude Code
Summary by CodeRabbit