Skip to content

Simplify code with extension properties - #235

Merged
viceroypenguin merged 1 commit into
masterfrom
extensions
Nov 20, 2025
Merged

viceroypenguin merged 1 commit into
masterfrom
extensions

Conversation

@viceroypenguin

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Nov 20, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 63 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Common/ITypeSymbolExtensions.cs 0.00% 63 Missing ⚠️
Files with missing lines Coverage Δ
src/Common/ITypeSymbolExtensions.cs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the ITypeSymbolExtensions class by introducing C# 13 extension properties to eliminate repetitive nested namespace checking patterns. The changes make the code more maintainable and readable by extracting common namespace validation logic into reusable extension properties.

Key changes:

  • Introduced three extension properties on INamespaceSymbol to check for common namespaces: IsSystemCollectionsGeneric, IsImmediateValidationsShared, and IsImmediateHandlersShared
  • Converted the private helper method IsValidTargetTypeType to a private extension property on ITypeSymbol
  • Added missing Arity: 0 checks to several attribute validation methods for consistency
  • Simplified IsTargetTypeSymbol by replacing a switch expression with pattern matching using the or operator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@viceroypenguin
viceroypenguin merged commit 5d50510 into master Nov 20, 2025
8 checks passed
@viceroypenguin
viceroypenguin deleted the extensions branch November 20, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants