| | | 1 | | using Microsoft.CodeAnalysis; |
| | | 2 | | |
| | | 3 | | namespace NexusLabs.Needlr.Generators.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// A discovered <c>[RegisterClosedOverImplementationsOf]</c> marker on an open generic composition type, |
| | | 7 | | /// captured during type collection for later expansion into closed registrations. |
| | | 8 | | /// </summary> |
| | | 9 | | internal readonly struct DiscoveredComposedMarker |
| | | 10 | | { |
| | | 11 | | public DiscoveredComposedMarker( |
| | | 12 | | INamedTypeSymbol compositionType, |
| | | 13 | | INamedTypeSymbol sourceOpenGenericInterface, |
| | | 14 | | INamedTypeSymbol? asServiceType, |
| | | 15 | | GeneratorLifetime lifetime, |
| | | 16 | | string assemblyName, |
| | | 17 | | string? sourceFilePath) |
| | | 18 | | { |
| | 68 | 19 | | CompositionType = compositionType; |
| | 68 | 20 | | SourceOpenGenericInterface = sourceOpenGenericInterface; |
| | 68 | 21 | | AsServiceType = asServiceType; |
| | 68 | 22 | | Lifetime = lifetime; |
| | 68 | 23 | | AssemblyName = assemblyName; |
| | 68 | 24 | | SourceFilePath = sourceFilePath; |
| | 68 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary>The open generic composition type carrying the attribute (e.g., FooCore{TData}).</summary> |
| | 264 | 28 | | public INamedTypeSymbol CompositionType { get; } |
| | | 29 | | |
| | | 30 | | /// <summary>The open generic interface whose closed implementations drive registration (e.g., IFooDefinition{}).</s |
| | 102 | 31 | | public INamedTypeSymbol SourceOpenGenericInterface { get; } |
| | | 32 | | |
| | | 33 | | /// <summary>The facade service type each closed composition is registered as, or null if unspecified.</summary> |
| | 136 | 34 | | public INamedTypeSymbol? AsServiceType { get; } |
| | | 35 | | |
| | | 36 | | /// <summary>The lifetime each closed registration is given.</summary> |
| | 54 | 37 | | public GeneratorLifetime Lifetime { get; } |
| | | 38 | | |
| | | 39 | | /// <summary>The name of the assembly that declared the composition type.</summary> |
| | 54 | 40 | | public string AssemblyName { get; } |
| | | 41 | | |
| | | 42 | | /// <summary>The source file path of the composition type, if available.</summary> |
| | 88 | 43 | | public string? SourceFilePath { get; } |
| | | 44 | | } |