From b979d381348991226f8ec9078818fdfdea708bfa Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 21 Apr 2024 00:27:06 -0400 Subject: [PATCH] fixed a bug where scanning would not properly emit the assembly attributes (#1541) --- .../Support/AssemblyCollection.cs | 2 +- ...20a7#Compiled_AssemblyProvider.verified.cs | 15 ++- ...8409#Compiled_AssemblyProvider.verified.cs | 95 ++++++++++++++++++- ...e759#Compiled_AssemblyProvider.verified.cs | 30 +++++- ...7875#Compiled_AssemblyProvider.verified.cs | 49 +++++++++- ...8e91#Compiled_AssemblyProvider.verified.cs | 21 +++- ...731c#Compiled_AssemblyProvider.verified.cs | 11 ++- ...c152#Compiled_AssemblyProvider.verified.cs | 62 +++++++++++- ...dc41#Compiled_AssemblyProvider.verified.cs | 9 +- ...22e0#Compiled_AssemblyProvider.verified.cs | 32 ++++++- ...0207#Compiled_AssemblyProvider.verified.cs | 63 +++++++++++- ...4b4b#Compiled_AssemblyProvider.verified.cs | 53 ++++++++++- ...dce8#Compiled_AssemblyProvider.verified.cs | 92 +++++++++++++++++- ...8acc#Compiled_AssemblyProvider.verified.cs | 12 ++- ...060c#Compiled_AssemblyProvider.verified.cs | 20 +++- ...41e9#Compiled_AssemblyProvider.verified.cs | 38 +++++++- ...9df0#Compiled_AssemblyProvider.verified.cs | 40 +++++++- ...5440#Compiled_AssemblyProvider.verified.cs | 55 ++++++++++- ...3717#Compiled_AssemblyProvider.verified.cs | 48 +++++++++- ...30a0#Compiled_AssemblyProvider.verified.cs | 63 +++++++++++- ...26e5#Compiled_AssemblyProvider.verified.cs | 22 ++++- ...d4c0#Compiled_AssemblyProvider.verified.cs | 38 +++++++- ...3eab#Compiled_AssemblyProvider.verified.cs | 95 ++++++++++++++++++- ...0d14#Compiled_AssemblyProvider.verified.cs | 19 +++- ...7c85#Compiled_AssemblyProvider.verified.cs | 32 ++++++- ...6981#Compiled_AssemblyProvider.verified.cs | 33 ++++++- ...5784#Compiled_AssemblyProvider.verified.cs | 25 ++++- ...1901#Compiled_AssemblyProvider.verified.cs | 20 +++- ...b3c8#Compiled_AssemblyProvider.verified.cs | 34 ++++++- ...3b1b#Compiled_AssemblyProvider.verified.cs | 54 ++++++++++- ...3773#Compiled_AssemblyProvider.verified.cs | 63 +++++++++++- ...c9d0#Compiled_AssemblyProvider.verified.cs | 66 ++++++++++++- ...667b#Compiled_AssemblyProvider.verified.cs | 70 +++++++++++++- ...6c55#Compiled_AssemblyProvider.verified.cs | 24 ++++- ...3d76#Compiled_AssemblyProvider.verified.cs | 90 +++++++++++++++++- ...f439#Compiled_AssemblyProvider.verified.cs | 9 +- ...0e4c#Compiled_AssemblyProvider.verified.cs | 63 +++++++++++- ...2b2a#Compiled_AssemblyProvider.verified.cs | 62 +++++++++++- ...7f1c#Compiled_AssemblyProvider.verified.cs | 40 +++++++- ...8215#Compiled_AssemblyProvider.verified.cs | 17 +++- ...a210#Compiled_AssemblyProvider.verified.cs | 20 +++- ...e4c6#Compiled_AssemblyProvider.verified.cs | 55 ++++++++++- ...a261#Compiled_AssemblyProvider.verified.cs | 86 ++++++++++++++++- ...b927#Compiled_AssemblyProvider.verified.cs | 8 +- 44 files changed, 1749 insertions(+), 106 deletions(-) diff --git a/src/Conventions.Analyzers/Support/AssemblyCollection.cs b/src/Conventions.Analyzers/Support/AssemblyCollection.cs index 79742b69c..dbc09746b 100644 --- a/src/Conventions.Analyzers/Support/AssemblyCollection.cs +++ b/src/Conventions.Analyzers/Support/AssemblyCollection.cs @@ -83,7 +83,7 @@ CollectRequest request ); } - if (cu.Members.Count == 0) return; + if (cu is { Members: [], AttributeLists: [], }) return; context.AddSource( "Compiled_AssemblyProvider.cs", diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_062f1d45310020a7#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_062f1d45310020a7#Compiled_AssemblyProvider.verified.cs index d6fd233ff..4334ae8f6 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_062f1d45310020a7#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_062f1d45310020a7#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,20 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_064862241a518409#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_064862241a518409#Compiled_AssemblyProvider.verified.cs index d6fd233ff..9beac6344 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_064862241a518409#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_064862241a518409#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,96 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Microsoft.Extensions.Configuration.RocketSurgeryLoggingExtensions); + yield return RocketSurgeryConventions.GetType("Microsoft.Extensions.DependencyInjection.LoggingBuilder"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.RocketSurgeryServiceCollectionExtensions); + yield return typeof(global::Microsoft.Extensions.Logging.RocketSurgeryLoggingExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.ConventionContextHelpers"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Extensions.RocketSurgerySetupExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.LoggingExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AppDomainAssemblyProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AppDomainConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver+Dependency"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AssemblyConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ConventionFactoryBase); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DefaultAssemblyProvider"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DependencyClassification"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeFilter"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Testing.TestConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventions; + private Assembly RocketSurgeryConventions => _RocketSurgeryConventions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions, Version=version, Culture=neutral, PublicKeyToken=null")); + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_0c717c659573e759#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_0c717c659573e759#Compiled_AssemblyProvider.verified.cs index d6fd233ff..76481457f 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_0c717c659573e759#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_0c717c659573e759#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,31 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_10bc81430c347875#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_10bc81430c347875#Compiled_AssemblyProvider.verified.cs index d6fd233ff..47ab3e6df 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_10bc81430c347875#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_10bc81430c347875#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,50 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1bb1b5932d958e91#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1bb1b5932d958e91#Compiled_AssemblyProvider.verified.cs index d6fd233ff..21181f4c1 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1bb1b5932d958e91#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1bb1b5932d958e91#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,22 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1fea74b9be1a731c#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1fea74b9be1a731c#Compiled_AssemblyProvider.verified.cs index d6fd233ff..776642b70 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1fea74b9be1a731c#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_1fea74b9be1a731c#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,16 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_26d4f95b1b6cc152#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_26d4f95b1b6cc152#Compiled_AssemblyProvider.verified.cs index d6fd233ff..3bb3ec3f7 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_26d4f95b1b6cc152#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_26d4f95b1b6cc152#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,63 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationDebugViewContext); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationExtensions); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationKeyNameAttribute); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationPath); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationRootExtensions); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfiguration); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationBuilder); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationManager); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationProvider); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationRoot); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationSection); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationSource); + yield return typeof(global::Microsoft.Extensions.Configuration.RocketSurgeryLoggingExtensions); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ActivatorUtilities); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ActivatorUtilitiesUpdateHandler"); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorInfoEx"); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher"); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.ActivatorUtilities+FactoryParameterContext"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ActivatorUtilitiesConstructorAttribute); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.AsyncServiceScope); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.FromKeyedServicesAttribute); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IKeyedServiceProvider); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceCollection); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<>); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceProviderIsKeyedService); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceProviderIsService); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceScope); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.IServiceScopeFactory); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ISupportRequiredService); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.KeyedService); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.KeyedService+AnyKeyObj"); + yield return RocketSurgeryConventions.GetType("Microsoft.Extensions.DependencyInjection.LoggingBuilder"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ObjectFactory); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ObjectFactory<>); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.RocketSurgeryServiceCollectionExtensions); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceCollection); + yield return MicrosoftExtensionsDependencyInjectionAbstractions.GetType("Microsoft.Extensions.DependencyInjection.ServiceCollection+ServiceCollectionDebugView"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceDescriptor); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceKeyAttribute); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceLifetime); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceProviderKeyedServiceExtensions); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions); + break; + } } + + private Assembly _MicrosoftExtensionsDependencyInjectionAbstractions; + private Assembly MicrosoftExtensionsDependencyInjectionAbstractions => _MicrosoftExtensionsDependencyInjectionAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Microsoft.Extensions.DependencyInjection.Abstractions, Version=version, Culture=neutral, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")); + + private Assembly _RocketSurgeryConventions; + private Assembly RocketSurgeryConventions => _RocketSurgeryConventions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_275a1f113b2edc41#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_275a1f113b2edc41#Compiled_AssemblyProvider.verified.cs index d6fd233ff..451c26b9f 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_275a1f113b2edc41#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_275a1f113b2edc41#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,14 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.ImportsTypeAttribute); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_310cb9d83d2822e0#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_310cb9d83d2822e0#Compiled_AssemblyProvider.verified.cs index d6fd233ff..4ac477dc1 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_310cb9d83d2822e0#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_310cb9d83d2822e0#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,33 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_31fa7513df300207#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_31fa7513df300207#Compiled_AssemblyProvider.verified.cs index d6fd233ff..21a474a9c 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_31fa7513df300207#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_31fa7513df300207#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,64 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_33d728bb823b4b4b#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_33d728bb823b4b4b#Compiled_AssemblyProvider.verified.cs index d6fd233ff..33802cf44 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_33d728bb823b4b4b#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_33d728bb823b4b4b#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,54 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b571657411cdce8#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b571657411cdce8#Compiled_AssemblyProvider.verified.cs index d6fd233ff..7bf2f803c 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b571657411cdce8#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b571657411cdce8#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,93 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Microsoft.Extensions.Configuration.RocketSurgeryLoggingExtensions); + yield return RocketSurgeryConventions.GetType("Microsoft.Extensions.DependencyInjection.LoggingBuilder"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.RocketSurgeryServiceCollectionExtensions); + yield return typeof(global::Microsoft.Extensions.Logging.RocketSurgeryLoggingExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.ConventionContextHelpers"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Extensions.RocketSurgerySetupExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.LoggingExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AppDomainAssemblyProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AppDomainConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver+Dependency"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AssemblyConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ConventionFactoryBase); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DefaultAssemblyProvider"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DependencyClassification"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeFilter"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Testing.TestConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventions; + private Assembly RocketSurgeryConventions => _RocketSurgeryConventions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions, Version=version, Culture=neutral, PublicKeyToken=null")); + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b61cd548dce8acc#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b61cd548dce8acc#Compiled_AssemblyProvider.verified.cs index d6fd233ff..f2609825c 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b61cd548dce8acc#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_3b61cd548dce8acc#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,17 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::TestConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4a0b3684516b060c#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4a0b3684516b060c#Compiled_AssemblyProvider.verified.cs index d6fd233ff..0d8a1b023 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4a0b3684516b060c#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4a0b3684516b060c#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,25 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Sample.DependencyOne.Class1); + yield return typeof(global::Sample.DependencyThree.Class3); + yield return typeof(global::Sample.DependencyTwo.Nested.Class2); + yield return typeof(global::TestConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4e8a928d4f9441e9#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4e8a928d4f9441e9#Compiled_AssemblyProvider.verified.cs index d6fd233ff..10a12df2e 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4e8a928d4f9441e9#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_4e8a928d4f9441e9#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,39 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_58a07f03d8889df0#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_58a07f03d8889df0#Compiled_AssemblyProvider.verified.cs index d6fd233ff..1665607e7 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_58a07f03d8889df0#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_58a07f03d8889df0#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,41 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5a59498e9edb5440#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5a59498e9edb5440#Compiled_AssemblyProvider.verified.cs index d6fd233ff..305a60b9e 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5a59498e9edb5440#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5a59498e9edb5440#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,56 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5bb8b41f6fcd3717#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5bb8b41f6fcd3717#Compiled_AssemblyProvider.verified.cs index d6fd233ff..e29b59d95 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5bb8b41f6fcd3717#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_5bb8b41f6fcd3717#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,49 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_63b620f18e4e30a0#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_63b620f18e4e30a0#Compiled_AssemblyProvider.verified.cs index d6fd233ff..21a474a9c 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_63b620f18e4e30a0#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_63b620f18e4e30a0#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,64 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6a1f8979c61826e5#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6a1f8979c61826e5#Compiled_AssemblyProvider.verified.cs index d6fd233ff..2695ca013 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6a1f8979c61826e5#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6a1f8979c61826e5#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,23 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AppDomainAssemblyProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AppDomainConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AssemblyConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyProviderAssemblySelector"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DefaultAssemblyProvider"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeFilter"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeProviderAssemblySelector"); + break; + } } + + private Assembly _RocketSurgeryConventions; + private Assembly RocketSurgeryConventions => _RocketSurgeryConventions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6bb99eb6b1e2d4c0#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6bb99eb6b1e2d4c0#Compiled_AssemblyProvider.verified.cs index d6fd233ff..f93d64911 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6bb99eb6b1e2d4c0#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6bb99eb6b1e2d4c0#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,39 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6e58ff7811413eab#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6e58ff7811413eab#Compiled_AssemblyProvider.verified.cs index d6fd233ff..9beac6344 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6e58ff7811413eab#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_6e58ff7811413eab#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,96 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Microsoft.Extensions.Configuration.RocketSurgeryLoggingExtensions); + yield return RocketSurgeryConventions.GetType("Microsoft.Extensions.DependencyInjection.LoggingBuilder"); + yield return typeof(global::Microsoft.Extensions.DependencyInjection.RocketSurgeryServiceCollectionExtensions); + yield return typeof(global::Microsoft.Extensions.Logging.RocketSurgeryLoggingExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.ConventionContextHelpers"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Extensions.RocketSurgerySetupExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.LoggingExtensions"); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AppDomainAssemblyProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AppDomainConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyCandidateResolver+Dependency"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.AssemblyConventionFactory); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.AssemblyProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ConventionFactoryBase); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DefaultAssemblyProvider"); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.DependencyClassification"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeFilter"); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return RocketSurgeryConventions.GetType("Rocket.Surgery.Conventions.Reflection.TypeProviderAssemblySelector"); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Testing.TestConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventions; + private Assembly RocketSurgeryConventions => _RocketSurgeryConventions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions, Version=version, Culture=neutral, PublicKeyToken=null")); + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_753b5793e84d0d14#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_753b5793e84d0d14#Compiled_AssemblyProvider.verified.cs index d6fd233ff..e882f9703 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_753b5793e84d0d14#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_753b5793e84d0d14#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,20 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7bf634e78b107c85#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7bf634e78b107c85#Compiled_AssemblyProvider.verified.cs index d6fd233ff..4ac477dc1 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7bf634e78b107c85#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7bf634e78b107c85#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,33 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7fa281b066d46981#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7fa281b066d46981#Compiled_AssemblyProvider.verified.cs index d6fd233ff..b03d6330b 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7fa281b066d46981#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_7fa281b066d46981#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,34 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_850fa96ec5445784#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_850fa96ec5445784#Compiled_AssemblyProvider.verified.cs index d6fd233ff..6bcef360a 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_850fa96ec5445784#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_850fa96ec5445784#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,26 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_92d6b065a1071901#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_92d6b065a1071901#Compiled_AssemblyProvider.verified.cs index d6fd233ff..0991584d5 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_92d6b065a1071901#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_92d6b065a1071901#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,25 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationDebugViewContext); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationExtensions); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationKeyNameAttribute); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationPath); + yield return typeof(global::Microsoft.Extensions.Configuration.ConfigurationRootExtensions); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfiguration); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationBuilder); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationManager); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationProvider); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationRoot); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationSection); + yield return typeof(global::Microsoft.Extensions.Configuration.IConfigurationSource); + yield return typeof(global::Microsoft.Extensions.Configuration.RocketSurgeryLoggingExtensions); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9951ed8ec232b3c8#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9951ed8ec232b3c8#Compiled_AssemblyProvider.verified.cs index d6fd233ff..6318a1302 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9951ed8ec232b3c8#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9951ed8ec232b3c8#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,35 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9ce923623b263b1b#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9ce923623b263b1b#Compiled_AssemblyProvider.verified.cs index d6fd233ff..e524b6b60 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9ce923623b263b1b#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9ce923623b263b1b#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,59 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9f72b60384383773#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9f72b60384383773#Compiled_AssemblyProvider.verified.cs index d6fd233ff..73e875d50 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9f72b60384383773#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_9f72b60384383773#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,64 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a95f3997d1d7c9d0#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a95f3997d1d7c9d0#Compiled_AssemblyProvider.verified.cs index d6fd233ff..5267f1842 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a95f3997d1d7c9d0#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a95f3997d1d7c9d0#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,67 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a9baadfc91ce667b#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a9baadfc91ce667b#Compiled_AssemblyProvider.verified.cs index d6fd233ff..b418fa0f3 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a9baadfc91ce667b#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_a9baadfc91ce667b#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,71 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ab0faba7cb546c55#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ab0faba7cb546c55#Compiled_AssemblyProvider.verified.cs index d6fd233ff..2d84ec5c8 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ab0faba7cb546c55#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ab0faba7cb546c55#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,25 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return SampleDependencyOne.GetType("Sample.DependencyOne.Example1+Validator"); + yield return SampleDependencyThree.GetType("Sample.DependencyThree.Example3+Validator"); + yield return SampleDependencyTwo.GetType("Sample.DependencyTwo.Example2+Validator"); + break; + } } + + private Assembly _SampleDependencyOne; + private Assembly SampleDependencyOne => _SampleDependencyOne ??= context.LoadFromAssemblyName(new AssemblyName("SampleDependencyOne, Version=version, Culture=neutral, PublicKeyToken=null")); + + private Assembly _SampleDependencyThree; + private Assembly SampleDependencyThree => _SampleDependencyThree ??= context.LoadFromAssemblyName(new AssemblyName("SampleDependencyThree, Version=version, Culture=neutral, PublicKeyToken=null")); + + private Assembly _SampleDependencyTwo; + private Assembly SampleDependencyTwo => _SampleDependencyTwo ??= context.LoadFromAssemblyName(new AssemblyName("SampleDependencyTwo, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_bd5b6e7e3f0b3d76#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_bd5b6e7e3f0b3d76#Compiled_AssemblyProvider.verified.cs index d6fd233ff..6abf6329d 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_bd5b6e7e3f0b3d76#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_bd5b6e7e3f0b3d76#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,91 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.ImportsTypeAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_c717f84dd70ef439#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_c717f84dd70ef439#Compiled_AssemblyProvider.verified.cs index d6fd233ff..451c26b9f 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_c717f84dd70ef439#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_c717f84dd70ef439#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,14 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.ImportsTypeAttribute); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_dcfd503800530e4c#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_dcfd503800530e4c#Compiled_AssemblyProvider.verified.cs index d6fd233ff..73e875d50 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_dcfd503800530e4c#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_dcfd503800530e4c#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,64 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e1c7a7dd2e012b2a#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e1c7a7dd2e012b2a#Compiled_AssemblyProvider.verified.cs index d6fd233ff..d9660e9af 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e1c7a7dd2e012b2a#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e1c7a7dd2e012b2a#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,67 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.ImportsTypeAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e7e3749287ca7f1c#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e7e3749287ca7f1c#Compiled_AssemblyProvider.verified.cs index d6fd233ff..e7508a0f7 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e7e3749287ca7f1c#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e7e3749287ca7f1c#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,41 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e890b0c93d778215#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e890b0c93d778215#Compiled_AssemblyProvider.verified.cs index d6fd233ff..2fa2771f7 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e890b0c93d778215#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_e890b0c93d778215#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,18 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ecfd3a811944a210#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ecfd3a811944a210#Compiled_AssemblyProvider.verified.cs index d6fd233ff..0d8a1b023 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ecfd3a811944a210#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ecfd3a811944a210#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,25 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Sample.DependencyOne.Class1); + yield return typeof(global::Sample.DependencyThree.Class3); + yield return typeof(global::Sample.DependencyTwo.Nested.Class2); + yield return typeof(global::TestConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ee3ba64f2f2fe4c6#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ee3ba64f2f2fe4c6#Compiled_AssemblyProvider.verified.cs index d6fd233ff..266dcd50e 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ee3ba64f2f2fe4c6#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_ee3ba64f2f2fe4c6#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,60 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.IServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyInjection.ServiceConvention); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + break; + } } } } diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6ad952111afa261#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6ad952111afa261#Compiled_AssemblyProvider.verified.cs index d6fd233ff..cc54d7ae8 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6ad952111afa261#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6ad952111afa261#Compiled_AssemblyProvider.verified.cs @@ -8,14 +8,15 @@ using Microsoft.Extensions.DependencyInjection; using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.Reflection; +using System.Runtime.Loader; namespace TestProject.Conventions { internal sealed partial class Imports { - public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(); + public IAssemblyProvider CreateAssemblyProvider(ConventionContextBuilder builder) => new AssemblyProvider(builder.Properties.GetRequiredService()); [System.CodeDom.Compiler.GeneratedCode("Rocket.Surgery.Conventions.Analyzers", "version"), System.Runtime.CompilerServices.CompilerGenerated, System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - private class AssemblyProvider() : IAssemblyProvider + private class AssemblyProvider(AssemblyLoadContext context) : IAssemblyProvider { IEnumerable IAssemblyProvider.GetAssemblies(Action action, string filePath, string memberName, int lineNumber) { @@ -24,8 +25,87 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::Rocket.Surgery.Conventions.AbstractConventionContextBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.IServiceFactoryAdapter"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.Adapters.ServiceFactoryAdapter`1"); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.AfterConventionAttribute<>); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.AssemblyProviderFactory"); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.BeforeConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderApplicationDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderDelegateResult); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationBuilderEnvironmentDelegate); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.ConfigurationOptionsExtensions); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Configuration.IConfigurationConvention); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextBuilder); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionContextExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionDependency"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionHostBuilderExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionHostBuilderExtensions+ServiceProviderWrapper`1"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionOrDelegate"); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ConventionProvider"); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionsConfigurationAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ConventionWithDependencies); + yield return typeof(global::Rocket.Surgery.Conventions.DependencyDirection); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependentOfConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.DependsOnConventionAttribute<>); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ExportedConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.HostType); + yield return typeof(global::Rocket.Surgery.Conventions.IAssemblyProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConvention); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionContext); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionDependency); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionFactory); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionProvider); + yield return typeof(global::Rocket.Surgery.Conventions.IConventionWithDependencies); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.IHostBasedConvention"); + yield return typeof(global::Rocket.Surgery.Conventions.ImportConventionsAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.ImportHelpers); + yield return typeof(global::Rocket.Surgery.Conventions.ImportsTypeAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.IReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.IServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.LiveConventionAttribute); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.ILoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.LoggingConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Logging.RocketLoggingOptions); + yield return typeof(global::Rocket.Surgery.Conventions.ReadOnlyServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.IAssemblyProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeProviderAssemblySelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.ITypeSelector); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeInfoFilter); + yield return typeof(global::Rocket.Surgery.Conventions.Reflection.TypeKindFilter); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionary); + yield return typeof(global::Rocket.Surgery.Conventions.ServiceProviderDictionaryExtensions); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ServiceProviderFactoryAdapter"); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.ISetupConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupAsyncConvention); + yield return typeof(global::Rocket.Surgery.Conventions.Setup.SetupConvention); + yield return RocketSurgeryConventionsAbstractions.GetType("Rocket.Surgery.Conventions.ThrowHelper"); + yield return typeof(global::Rocket.Surgery.Conventions.UnitTestConventionAttribute); + break; + } } + + private Assembly _RocketSurgeryConventionsAbstractions; + private Assembly RocketSurgeryConventionsAbstractions => _RocketSurgeryConventionsAbstractions ??= context.LoadFromAssemblyName(new AssemblyName("Rocket.Surgery.Conventions.Abstractions, Version=version, Culture=neutral, PublicKeyToken=null")); } } } \ No newline at end of file diff --git a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6bd7df8091db927#Compiled_AssemblyProvider.verified.cs b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6bd7df8091db927#Compiled_AssemblyProvider.verified.cs index d6fd233ff..af30fd281 100644 --- a/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6bd7df8091db927#Compiled_AssemblyProvider.verified.cs +++ b/test/Analyzers.Tests/snapshots/AssemblyProviderTests.Should_Generate_Assembly_Provider_For_GetTypes_From_Another_Assembly_f6bd7df8091db927#Compiled_AssemblyProvider.verified.cs @@ -24,7 +24,13 @@ IEnumerable IAssemblyProvider.GetAssemblies(Action IAssemblyProvider.GetTypes(Func> selector, string filePath, string memberName, int lineNumber) { - yield break; + switch (lineNumber) + { + // FilePath: Input0.cs Member: Register + case 18: + yield return typeof(global::TestConvention); + break; + } } } }