1 write to _knownSymbols
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
68
_knownSymbols
= knownSymbols;
54 references to _knownSymbols
System.Text.Json.SourceGeneration (54)
JsonSourceGenerator.Parser.cs (54)
57
if (location is null || !
_knownSymbols
.Compilation.ContainsLocation(location))
85
Debug.Assert(
_knownSymbols
.JsonSerializerContextType != null);
98
if (!
_knownSymbols
.JsonSerializerContextType.IsAssignableFrom(contextTypeSymbol))
118
LanguageVersion? langVersion =
_knownSymbols
.Compilation.GetLanguageVersion();
210
type =
_knownSymbols
.Compilation.EraseCompileTimeMetadata(type);
234
Debug.Assert(
_knownSymbols
.JsonSerializableAttributeType != null);
235
Debug.Assert(
_knownSymbols
.JsonSourceGenerationOptionsAttributeType != null);
244
if (SymbolEqualityComparer.Default.Equals(attributeClass,
_knownSymbols
.JsonSerializableAttributeType))
254
else if (SymbolEqualityComparer.Default.Equals(attributeClass,
_knownSymbols
.JsonSourceGenerationOptionsAttributeType))
483
if (location is null || !
_knownSymbols
.Compilation.ContainsLocation(location))
491
Type =
_knownSymbols
.Compilation.EraseCompileTimeMetadata(typeSymbol),
558
Debug.Assert(
_knownSymbols
.JsonStringEnumConverterOfTType != null);
559
INamedTypeSymbol converterSymbol =
_knownSymbols
.JsonStringEnumConverterOfTType.Construct(type);
594
constructorSetsRequiredMembers = defaultCtor?.ContainsAttribute(
_knownSymbols
.SetsRequiredMembersAttributeType) == true;
613
bool useDefaultCtorInAnnotatedStructs = type.GetCompatibleGenericBaseType(
_knownSymbols
.KeyValuePair) is null;
627
implementsIJsonOnSerializing =
_knownSymbols
.IJsonOnSerializingType.IsAssignableFrom(type);
628
implementsIJsonOnSerialized =
_knownSymbols
.IJsonOnSerializedType.IsAssignableFrom(type);
703
if (SymbolEqualityComparer.Default.Equals(attributeType,
_knownSymbols
.JsonNumberHandlingAttributeType))
708
else if (SymbolEqualityComparer.Default.Equals(attributeType,
_knownSymbols
.JsonUnmappedMemberHandlingAttributeType))
713
else if (SymbolEqualityComparer.Default.Equals(attributeType,
_knownSymbols
.JsonObjectCreationHandlingAttributeType))
718
else if (!foundJsonConverterAttribute &&
_knownSymbols
.JsonConverterAttributeType.IsAssignableFrom(attributeType))
724
if (SymbolEqualityComparer.Default.Equals(attributeType,
_knownSymbols
.JsonDerivedTypeAttributeType))
755
if (SymbolEqualityComparer.Default.Equals(type.OriginalDefinition,
_knownSymbols
.MemoryType))
757
Debug.Assert(!SymbolEqualityComparer.Default.Equals(type,
_knownSymbols
.MemoryByteType));
763
if (SymbolEqualityComparer.Default.Equals(type.OriginalDefinition,
_knownSymbols
.ReadOnlyMemoryType))
765
Debug.Assert(!SymbolEqualityComparer.Default.Equals(type,
_knownSymbols
.ReadOnlyMemoryByteType));
772
if (type.GetCompatibleGenericBaseType(
_knownSymbols
.IAsyncEnumerableOfTType) is INamedTypeSymbol iAsyncEnumerableType)
779
if (!
_knownSymbols
.IEnumerableType.IsAssignableFrom(type))
791
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.KeyedCollectionType)) != null)
796
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.ListOfTType)) != null)
801
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.DictionaryOfTKeyTValueType)) != null)
807
else if (
_knownSymbols
.IsImmutableDictionaryType(type, out immutableCollectionFactoryTypeFullName))
814
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.IDictionaryOfTKeyTValueType)) != null)
821
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.IReadonlyDictionaryOfTKeyTValueType)) != null)
828
else if (
_knownSymbols
.IsImmutableEnumerableType(type, out immutableCollectionFactoryTypeFullName))
833
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.IListOfTType)) != null)
838
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.ISetOfTType)) != null)
843
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.ICollectionOfTType)) != null)
848
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.StackOfTType)) != null)
853
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.QueueOfTType)) != null)
858
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.ConcurrentStackType)) != null)
863
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.ConcurrentQueueType)) != null)
868
else if ((actualTypeToConvert = type.GetCompatibleGenericBaseType(
_knownSymbols
.IEnumerableOfTType)) != null)
873
else if (
_knownSymbols
.IDictionaryType.IsAssignableFrom(type))
876
keyType =
_knownSymbols
.StringType;
877
valueType =
_knownSymbols
.ObjectType;
880
else if (
_knownSymbols
.IListType.IsAssignableFrom(type))
883
valueType =
_knownSymbols
.ObjectType;
885
else if (
_knownSymbols
.StackType.IsAssignableFrom(type))
888
valueType =
_knownSymbols
.ObjectType;
890
else if (
_knownSymbols
.QueueType.IsAssignableFrom(type))
893
valueType =
_knownSymbols
.ObjectType;
898
valueType =
_knownSymbols
.ObjectType;
906
INamedTypeSymbol? dictionary =
_knownSymbols
.DictionaryOfTKeyTValueType?.Construct(keyType, valueType);