Skip to content

Conversation

@Dreamescaper
Copy link
Owner

@Dreamescaper Dreamescaper commented Jun 17, 2025

Fixes #35 .

@Dreamescaper Dreamescaper requested a review from Copilot June 17, 2025 16:11
Copy link
Contributor

Copilot AI left a comment

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 enhances service registration generation to handle types implementing multiple matching open generic interfaces.

  • FilterTypes now returns all matched assignable types as an array.
  • FindServicesToRegister is updated to iterate and register each matched interface.
  • Two new tests verify multiple interface registrations and combined self/interface registrations.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ServiceScan.SourceGenerator/DependencyInjectionGenerator.FindServicesToRegister.cs Updated to unpack and use multiple matched types for service registrations
ServiceScan.SourceGenerator/DependencyInjectionGenerator.FilterTypes.cs Changed filter and assignability checks to return arrays of matched types
ServiceScan.SourceGenerator.Tests/AddServicesTests.cs Added tests for multiple open generic interfaces and renamed an existing test

@Dreamescaper Dreamescaper changed the title Add multiple registrations if implementation has multiple matching open generic interfaces Add multiple registrations if service implements open generic interface more than once Jun 17, 2025
@Dreamescaper Dreamescaper merged commit 1aa340d into main Jun 17, 2025
1 check passed
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.

Scanning for services implementing an open generic interface more than once only registers once unless AsImplementedInterfaces = true

2 participants