Skip to content

Add [RegisterXxx<TService,TImplementation>] support#5

Merged
viceroypenguin merged 2 commits into
mainfrom
register-classes
May 24, 2026
Merged

Add [RegisterXxx<TService,TImplementation>] support#5
viceroypenguin merged 2 commits into
mainfrom
register-classes

Conversation

@viceroypenguin
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 23, 2026 23:59
@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 93.29609% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nerators/ImmediateInjectionsGenerator.Transform.cs 90.16% 5 Missing and 1 partial ⚠️
....Generators/ImmediateInjectionsGenerator.Render.cs 94.64% 2 Missing and 1 partial ⚠️
src/Common/ITypeSymbolExtensions.cs 90.90% 0 Missing and 2 partials ⚠️
...ections.Generators/ImmediateInjectionsGenerator.cs 97.50% 1 Missing ⚠️
Files with missing lines Coverage Δ
...ections.Generators/ImmediateInjectionsGenerator.cs 96.11% <97.50%> (+3.92%) ⬆️
src/Common/ITypeSymbolExtensions.cs 91.46% <90.90%> (-0.21%) ⬇️
....Generators/ImmediateInjectionsGenerator.Render.cs 97.22% <94.64%> (-2.78%) ⬇️
...nerators/ImmediateInjectionsGenerator.Transform.cs 92.00% <90.16%> (+49.69%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

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 extends the Immediate.Injections source generator to recognize and emit registrations for generic attribute forms like [RegisterXxx<TService, TImplementation>], adding new generator stages/templates plus a comprehensive set of snapshot-based tests to validate the emitted ServiceDescriptor calls (including keyed services, factories, tags, and duplicate strategies).

Changes:

  • Added a new RegisterClasses Scriban template and generator pipeline to emit II.Register{Lifetime}`2.g.csfor[Register{Lifetime}<TService, TImplementation>]`.
  • Added factory-method validation (IsValidFactoryMethod) and additional model/rendering logic to support keyed registrations and duplicate strategies.
  • Added new generator tests + updated snapshots; updated the incremental tracking step list accordingly.

Reviewed changes

Copilot reviewed 89 out of 89 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterServicesTests.ValidRegisterServicesMethodWhenLangVersionIs12#II.ServiceCollectionExtensions.g.verified.cs Snapshot updated to include generated Intersects helper in extensions output.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterServicesTests.ValidRegisterServicesMethodIsCalled2#II.ServiceCollectionExtensions.g.verified.cs Snapshot updated to include generated Intersects helper in extensions output.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterServicesTests.ValidRegisterServicesMethodIsCalled1#II.ServiceCollectionExtensions.g.verified.cs Snapshot updated to include generated Intersects helper in extensions output.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output when RegisterTransient<TService,TImpl> is used.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying Transient ServiceDescriptor for TService == TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output for Singleton variant.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying Singleton ServiceDescriptor for TService == TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output for Scoped variant.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TService_IsRegistered_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying Scoped ServiceDescriptor for TService == TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output for Transient TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying Transient ServiceDescriptor for TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output for Singleton TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying Singleton ServiceDescriptor for TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying extensions output for Scoped TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.ValidRegisterXxx_TService_TImplementation_IsRegistered_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying Scoped ServiceDescriptor for TService != TImplementation.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying tag-filtered registration output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying tag intersection gating logic (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying tag-filtered registration output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying tag intersection gating logic (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying tag-filtered registration output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidTags_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying tag intersection gating logic (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-factory registration output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying KeyedTransient factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-factory registration output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying KeyedSingleton factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-factory registration output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKeyedFactory_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying KeyedScoped factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-type registration output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying KeyedTransient type overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-type registration output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying KeyedSingleton type overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying keyed-type registration output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidKey_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying KeyedScoped type overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-keyed factory registration output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying Transient factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-keyed factory registration output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying Singleton factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-keyed factory registration output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_ValidFactory_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying Scoped factory overload emission.
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying TryAdd duplicate strategy output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying TryAdd call emission (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying TryAdd duplicate strategy output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying TryAdd call emission (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying TryAdd duplicate strategy output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Skip_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying TryAdd call emission (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Replace duplicate strategy output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying Replace call emission (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Replace duplicate strategy output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying Replace call emission (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Replace duplicate strategy output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Replace_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying Replace call emission (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_InvalidFactory_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying invalid-factory case emits no registration file (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_InvalidFactory_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying invalid-factory case emits no registration file (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_InvalidFactory_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying invalid-factory case emits no registration file (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Append (Add) output (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Transient#II.RegisterTransient`2.g.verified.cs New snapshot verifying Add call emission (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Append (Add) output (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Singleton#II.RegisterSingleton`2.g.verified.cs New snapshot verifying Add call emission (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying Append (Add) output (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.RegisterXxx_TService_TImplementation_Append_lifetime=Scoped#II.RegisterScoped`2.g.verified.cs New snapshot verifying Add call emission (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.NonGenericRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-generic service types are ignored (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.NonGenericRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-generic service types are ignored (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.NonGenericRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying non-generic service types are ignored (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.IncompatibleCastRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying incompatible conversion is rejected (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.IncompatibleCastRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying incompatible conversion is rejected (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.IncompatibleCastRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying incompatible conversion is rejected (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.DifferentTargetRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Transient#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying attribute target mismatch is rejected (Transient).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.DifferentTargetRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Singleton#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying attribute target mismatch is rejected (Singleton).
tests/Immediate.Injections.Tests/GeneratorTests/Snapshots/RegisterClass_TService_TImplementation_Tests.DifferentTargetRegisterXxx_TService_TImplementation_IsNotRegistered_lifetime=Scoped#II.ServiceCollectionExtensions.g.verified.cs New snapshot verifying attribute target mismatch is rejected (Scoped).
tests/Immediate.Injections.Tests/GeneratorTests/RegisterServicesTests.cs Updated to gate C# 12-specific test under NET8_0 and fully-qualify LanguageVersion.
tests/Immediate.Injections.Tests/GeneratorTests/RegisterClass{TService,TImplementation}Tests.cs New test suite covering [RegisterXxx<TService,TImplementation>] scenarios across lifetimes.
tests/Immediate.Injections.Tests/GeneratorTests/GeneratorTestHelper.cs Updated tracked incremental steps to include new Register{Lifetime} steps.
src/Immediate.Injections.Shared/RegisterTransientAttribute{TService}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterTransientAttribute{TService,TImplementation}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterTransientAttribute.cs Public attribute API updated; added remarks about open-generic registration.
src/Immediate.Injections.Shared/RegisterSingletonAttribute{TService}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterSingletonAttribute{TService,TImplementation}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterSingletonAttribute.cs Public attribute API updated; added remarks about open-generic registration.
src/Immediate.Injections.Shared/RegisterScopedAttribute{TService}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterScopedAttribute{TService,TImplementation}.cs Public attribute API updated (non-nullable DuplicateStrategy).
src/Immediate.Injections.Shared/RegisterScopedAttribute.cs Public attribute API updated; added remarks about open-generic registration.
src/Immediate.Injections.Generators/Templates/ServiceCollectionExtensions.sbntxt Added Intersects helper used by tag-filtered registrations.
src/Immediate.Injections.Generators/Templates/RegisterClasses.sbntxt New template for emitting lifetime/arity-specific registration methods.
src/Immediate.Injections.Generators/ImmediateInjectionsGenerator.Transform.cs Added transformation for [RegisterXxx<,>] and helper extensions for parsing arguments.
src/Immediate.Injections.Generators/ImmediateInjectionsGenerator.Render.cs Added rendering pipeline for new RegisterClasses template.
src/Immediate.Injections.Generators/ImmediateInjectionsGenerator.Models.cs Added RegisterClass model; simplified assembly defaults model.
src/Immediate.Injections.Generators/ImmediateInjectionsGenerator.cs Wired up new incremental steps for register-class processing.
src/Immediate.Injections.Generators/EquatableReadOnlyList.cs New list wrapper providing value equality (for incremental correctness).
src/Common/ITypeSymbolExtensions.cs Added IsIServiceProvider and factory method signature validation.

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

Comment thread src/Immediate.Injections.Shared/RegisterSingletonAttribute.cs
Comment thread src/Immediate.Injections.Shared/RegisterScopedAttribute.cs
@viceroypenguin viceroypenguin merged commit 10c0eea into main May 24, 2026
2 checks passed
@viceroypenguin viceroypenguin deleted the register-classes branch May 24, 2026 00:29
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