11 instantiations of TypeRef
System.Text.Json.SourceGeneration (11)
JsonSourceGenerator.Parser.cs (11)
182ContextType = new(contextTypeSymbol), 218return new TypeRef(type); 725customConverterType = new TypeRef(converterSymbol); 841: new TypeRef(patternType); 867var typeRef = new TypeRef(type); 2169return dictionary is null ? null : new TypeRef(dictionary); 2192var declaringTypeRef = new TypeRef(currentType); 2510: new TypeRef(memberType); 2846parameterTypeRef = new TypeRef(parameterInfo.Type); 3015return new TypeRef(namedConverterType); 3038return new TypeRef(namedClassifierType);
63 references to TypeRef
System.Text.Json.SourceGeneration (63)
JsonSourceGenerator.Emitter.cs (9)
69private readonly Dictionary<TypeRef, TypeGenerationSpec> _typeIndex = new(); 377TypeRef? collectionKeyType = typeGenerationSpec.CollectionKeyType; 382TypeRef? collectionValueType = typeGenerationSpec.CollectionValueType; 530TypeRef keyType = typeGenerationSpec.CollectionKeyType; 869TypeRef? nullableUnderlyingType = _typeIndex[property.PropertyType].NullableUnderlyingType; 2150foreach (TypeRef converter in converters) 2165foreach (TypeRef classifier in TypeClassifiers) 2413private static string FormatTypeClassifierFactory(TypeRef? classifierFactoryType) 2495{ RuntimeTypeRef: TypeRef runtimeType } => $"() => new {runtimeType.FullyQualifiedName}()",
JsonSourceGenerator.Parser.cs (31)
199private TypeRef EnqueueType(ITypeSymbol type, JsonSourceGenerationMode? generationMode) 379List<TypeRef>? converters = null; 380List<TypeRef>? typeClassifiers = null; 428converters = new List<TypeRef>(); 432TypeRef? typeRef = GetConverterTypeFromAttribute(contextType, converterType, contextType, attributeData, ref optionsExperimentalIds); 542typeClassifiers = new List<TypeRef>(); 546TypeRef? typeRef = GetTypeClassifierFactoryTypeFromAttribute(contextType, classifierType, contextType, attributeData, ref optionsExperimentalIds); 659TypeRef? collectionKeyType = null; 660TypeRef? collectionValueType = null; 661TypeRef? nullableUnderlyingType = null; 663TypeRef? runtimeTypeRef = null; 685out TypeRef? customConverterType, 688out TypeRef? unionClassifierFactoryType); 825TypeRef caseTypeRef = EnqueueType(caseType, typeToGenerate.Mode); 839TypeRef patternTypeRef = SymbolEqualityComparer.Default.Equals(patternType, caseType) 867var typeRef = new TypeRef(type); 948out TypeRef? customConverterType, 951out TypeRef? unionClassifierFactoryType) 970TypeRef? polymorphicClassifierFactoryType = null; 1268TypeRef derivedTypeRef = EnqueueType(derivedType, typeToGenerate.Mode); 2166private TypeRef? GetDictionaryTypeRef(ITypeSymbol keyType, ITypeSymbol valueType) 2192var declaringTypeRef = new TypeRef(currentType); 2251TypeRef declaringTypeRef, 2405TypeRef declaringType, 2430out TypeRef? converterType, 2508TypeRef propertyTypeRef = ignoreCondition != JsonIgnoreCondition.Always 2592out TypeRef? converterType, 2843TypeRef parameterTypeRef; 2958private TypeRef? GetConverterTypeFromJsonConverterAttribute(INamedTypeSymbol contextType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds, ITypeSymbol? typeToConvert = null) 2977private TypeRef? GetConverterTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? converterType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds, ITypeSymbol? typeToConvert = null) 3018private TypeRef? GetTypeClassifierFactoryTypeFromAttribute(INamedTypeSymbol contextType, ITypeSymbol? classifierType, ISymbol declaringSymbol, AttributeData attributeData, ref HashSet<string>? experimentalIds)
Model\ContextGenerationSpec.cs (1)
30public required TypeRef ContextType { get; init; }
Model\DerivedTypeSpec.cs (1)
19public required TypeRef DerivedType { get; init; }
Model\ParameterGenerationSpec.cs (1)
28public required TypeRef ParameterType { get; init; }
Model\PolymorphismOptionsSpec.cs (1)
24public required TypeRef? TypeClassifierFactoryType { get; init; }
Model\PropertyGenerationSpec.cs (3)
170public required TypeRef PropertyType { get; init; } 175public required TypeRef DeclaringType { get; init; } 187public required TypeRef? ConverterType { get; init; }
Model\PropertyInitializerGenerationSpec.cs (1)
29public required TypeRef ParameterType { get; init; }
Model\SourceGenerationOptionsSpec.cs (2)
23public required ImmutableEquatableArray<TypeRef>? Converters { get; init; } 25public required ImmutableEquatableArray<TypeRef>? TypeClassifiers { get; init; }
Model\TypeGenerationSpec.cs (7)
34public required TypeRef TypeRef { get; init; } 108public required TypeRef? UnionClassifierFactoryType { get; init; } 116public required TypeRef? CollectionKeyType { get; init; } 118public required TypeRef? CollectionValueType { get; init; } 137public required TypeRef? NullableUnderlyingType { get; init; } 143public required TypeRef? RuntimeTypeRef { get; init; } 147public required TypeRef? ConverterType { get; init; }
Model\UnionCaseSpec.cs (2)
19public required TypeRef CaseType { get; init; } 30public required TypeRef PatternType { get; init; }
src\runtime\src\libraries\Common\src\SourceGenerators\CSharpSyntaxUtilities.cs (1)
18public static string FormatLiteral(object? value, TypeRef type)
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (3)
14public sealed class TypeRef : IEquatable<TypeRef> 38public bool Equals(TypeRef? other) => other != null && FullyQualifiedName == other.FullyQualifiedName; 39public override bool Equals(object? obj) => Equals(obj as TypeRef);