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