4 types derived from TypeSpec
Microsoft.Extensions.Configuration.Binder.SourceGeneration (4)
Specs\Types\SimpleTypeSpec.cs (1)
8
public abstract record SimpleTypeSpec :
TypeSpec
Specs\Types\TypeSpec.cs (3)
51
public abstract record ComplexTypeSpec :
TypeSpec
56
internal sealed record NullableSpec :
TypeSpec
62
internal sealed record UnsupportedTypeSpec :
TypeSpec
46 references to TypeSpec
Microsoft.Extensions.Configuration.Binder.SourceGeneration (46)
ConfigurationBindingGenerator.Parser.cs (11)
26
private readonly Dictionary<ITypeSymbol,
TypeSpec
> _createdTypeSpecs = new(SymbolEqualityComparer.Default);
127
TypeSpec
typeSpec = _createdTypeSpecs[typeParseInfo.TypeSymbol];
164
if (_createdTypeSpecs.TryGetValue(memberTypeSymbol, out
TypeSpec
? memberTypeSpec))
174
private
TypeSpec
CreateTypeSpec(TypeParseInfo typeParseInfo)
177
TypeSpec
spec;
338
private
TypeSpec
CreateArraySpec(TypeParseInfo typeParseInfo)
363
private
TypeSpec
? CreateCollectionSpec(TypeParseInfo typeParseInfo)
367
TypeSpec
? spec;
382
private
TypeSpec
? CreateDictionarySpec(TypeParseInfo typeParseInfo, ITypeSymbol keyTypeSymbol, ITypeSymbol elementTypeSymbol)
454
private
TypeSpec
? CreateEnumerableSpec(TypeParseInfo typeParseInfo)
945
private void RecordTypeDiagnosticIfRequired(TypeParseInfo typeParseInfo,
TypeSpec
typeSpec)
Emitter\CoreBindingHelpers.cs (8)
47
foreach (
TypeSpec
type in types)
103
foreach (
TypeSpec
type in targetTypes)
105
TypeSpec
effectiveType = _typeIndex.GetEffectiveTypeSpec(type);
190
foreach (
TypeSpec
type in targetTypes)
376
TypeSpec
memberType = _typeIndex.GetTypeSpec(member.TypeRef);
419
TypeSpec
typeSpec = _typeIndex.GetEffectiveTypeSpec(member.TypeRef);
767
TypeSpec
elementType = _typeIndex.GetEffectiveTypeSpec(type.ElementTypeRef);
1006
TypeSpec
memberType = _typeIndex.GetTypeSpec(member.TypeRef);
Parser\ConfigurationBinder.cs (1)
254
private void RegisterInterceptor_ConfigurationBinder(TypeParseInfo typeParseInfo,
TypeSpec
typeSpec)
Parser\OptionsBuilderConfigurationExtensions.cs (1)
86
private void RegisterInterceptor_OptionsBuilderExt(TypeParseInfo typeParseInfo,
TypeSpec
typeSpec)
Parser\OptionsConfigurationServiceCollectionExtensions.cs (1)
79
private void RegisterInterceptor_ServiceCollectionExt(TypeParseInfo typeParseInfo,
TypeSpec
typeSpec)
Specs\BindingHelperInfo.cs (14)
19
public required ImmutableEquatableArray<
TypeSpec
>? TypesForGen_GetCore { get; init; }
20
public required ImmutableEquatableArray<
TypeSpec
>? TypesForGen_GetValueCore { get; init; }
32
private readonly Dictionary<MethodsToGen_CoreBindingHelper, HashSet<
TypeSpec
>> _typesForGen = new();
51
TypesForGen_GetCore = GetTypesForGen_CoreBindingHelper<
TypeSpec
>(MethodsToGen_CoreBindingHelper.GetCore),
53
TypesForGen_GetValueCore = GetTypesForGen_CoreBindingHelper<
TypeSpec
>(MethodsToGen_CoreBindingHelper.GetValueCore),
60
where TSpec :
TypeSpec
, IEquatable<TSpec>
62
_typesForGen.TryGetValue(overload, out HashSet<
TypeSpec
>? typesAsBase);
69
IEnumerable<TSpec> types = typeof(TSpec) == typeof(
TypeSpec
)
77
where TSpec :
TypeSpec
, IEquatable<TSpec> =>
81
public bool TryRegisterTypeForGetGen(
TypeSpec
type)
93
public bool TryRegisterTypeForGetValueGen(
TypeSpec
typeSpec)
217
private void RegisterTypeForMethodGen(MethodsToGen_CoreBindingHelper method,
TypeSpec
type)
219
if (!_typesForGen.TryGetValue(method, out HashSet<
TypeSpec
>? types))
221
_typesForGen[method] = types = new HashSet<
TypeSpec
>();
Specs\SourceGenerationSpec.cs (1)
12
public required ImmutableEquatableArray<
TypeSpec
> ConfigTypes { get; init; }
Specs\TypeIndex.cs (9)
12
internal sealed class TypeIndex(IEnumerable<
TypeSpec
> typeSpecs)
14
private readonly Dictionary<TypeRef,
TypeSpec
> _index = typeSpecs.ToDictionary(spec => spec.TypeRef);
42
TypeSpec
propTypeSpec = GetEffectiveTypeSpec(property.TypeRef);
56
public
TypeSpec
GetEffectiveTypeSpec(TypeRef typeRef)
58
TypeSpec
typeSpec = GetTypeSpec(typeRef);
62
public
TypeSpec
GetEffectiveTypeSpec(
TypeSpec
typeSpec)
65
TypeSpec
effectiveSpec = effectiveRef == typeSpec.TypeRef ? typeSpec : _index[effectiveRef];
69
public
TypeSpec
GetTypeSpec(TypeRef typeRef) => _index[typeRef];