Address misc feedback for config binder implementation (#84737)
authorLayomi Akinrinade <laakinri@microsoft.com>
Tue, 2 May 2023 15:18:41 +0000 (11:18 -0400)
committerGitHub <noreply@github.com>
Tue, 2 May 2023 15:18:41 +0000 (11:18 -0400)
* Move type graph specs into subfolder

* Address misc feedback for config binder implementation

43 files changed:
src/libraries/Common/tests/SourceGenerators/RoslynTestUtils.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/CollectionSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingSourceGenerator.Emitter.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingSourceGenerator.Helpers.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingSourceGenerator.Parser.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingSourceGenerator.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationSectionTypeSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConstructionStrategy.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ExceptionMessages.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Microsoft.Extensions.Configuration.Binder.SourceGeneration.csproj
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/NullableSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ObjectSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ParsableFromStringTypeSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PopulationStrategy.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PropertySpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/Strings.resx
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.cs.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.de.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.es.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.fr.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.it.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ja.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ko.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.pl.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.pt-BR.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ru.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.tr.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.zh-Hans.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.zh-Hant.xlf
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/SourceGenerationSpec.cs
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/CollectionSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConfigurationSectionTypeSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConstructionStrategy.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/NullableSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ObjectSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ParsableFromStringTypeSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/PropertySpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpec.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpecKind.cs [new file with mode: 0644]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpec.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpecKind.cs [deleted file]
src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/Baselines/TestConfigureCallGen.generated.txt
src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/Baselines/TestGetCallGen.generated.txt

index 32551b0736fc2feca6dcc7e0fdd42cef92421e57..da4da49fff976bd4825d7c4ee023caea297d056a 100644 (file)
@@ -271,7 +271,7 @@ namespace SourceGenerators.Tests
                 for (int i = 0; i < count; i++)
                 {
                     SourceText s = await proj.FindDocument(l[i]).GetTextAsync().ConfigureAwait(false);
-                    results.Add(Replace(s.ToString(), "\r\n", "\n"));
+                    results.Add(ReplaceLineEndings(s.ToString()));
                 }
             }
             else
@@ -279,14 +279,14 @@ namespace SourceGenerators.Tests
                 for (int i = 0; i < count; i++)
                 {
                     SourceText s = await proj.FindDocument($"src-{i}.cs").GetTextAsync().ConfigureAwait(false);
-                    results.Add(Replace(s.ToString(), "\r\n", "\n"));
+                    results.Add(ReplaceLineEndings(s.ToString()));
                 }
             }
 
             if (extraFile != null)
             {
                 SourceText s = await proj.FindDocument(extraFile).GetTextAsync().ConfigureAwait(false);
-                results.Add(Replace(s.ToString(), "\r\n", "\n"));
+                results.Add(ReplaceLineEndings(s.ToString()));
             }
 
             return results;
@@ -334,12 +334,11 @@ namespace SourceGenerators.Tests
             return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
         }
 
-        private static string Replace(string text, string oldText, string newText) =>
-            text.Replace(
-                oldText, newText
+        private static string ReplaceLineEndings(string text) =>
 #if NETCOREAPP
-                , StringComparison.Ordinal
+            text.ReplaceLineEndings("\n");
+#else
+            text.Replace("\r\n", "\n");
 #endif
-                );
     }
 }
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/CollectionSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/CollectionSpec.cs
deleted file mode 100644 (file)
index f86f668..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal abstract record CollectionSpec : TypeSpec
-    {
-        public CollectionSpec(ITypeSymbol type) : base(type)
-        {
-            IsReadOnly = type.IsReadOnly;
-            IsInterface = type is INamedTypeSymbol { TypeKind: TypeKind.Interface };
-        }
-
-        public required TypeSpec ElementType { get; init; }
-
-        public bool IsReadOnly { get; }
-
-        public bool IsInterface { get; }
-
-        public CollectionSpec? ConcreteType { get; init; }
-    }
-
-    internal sealed record ArraySpec : CollectionSpec
-    {
-        public ArraySpec(ITypeSymbol type) : base(type) { }
-
-        public override TypeSpecKind SpecKind => TypeSpecKind.Array;
-    }
-
-    internal sealed record EnumerableSpec : CollectionSpec
-    {
-        public EnumerableSpec(ITypeSymbol type) : base(type) { }
-
-        public override TypeSpecKind SpecKind => TypeSpecKind.Enumerable;
-    }
-
-    internal sealed record DictionarySpec : CollectionSpec
-    {
-        public DictionarySpec(INamedTypeSymbol type) : base(type) { }
-
-        public override TypeSpecKind SpecKind => TypeSpecKind.Dictionary;
-
-        public required ParsableFromStringTypeSpec KeyType { get; init; }
-    }
-}
index f9133090ed0c0a32932ce925b84229cde185db3e..e203558d5289955b8c74a806335114d3a48062d0 100644 (file)
@@ -102,7 +102,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                     _writer.WriteBlankLine();
                 }
 
-                Emit_NotSupportedException_UnableToBindType(NotSupportedReason.TypeNotDetectedAsInput);
+                Emit_NotSupportedException_TypeNotDetectedAsInput();
                 _writer.WriteBlockEnd();
             }
 
@@ -135,7 +135,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                     _writer.WriteBlankLine();
                 }
 
-                Emit_NotSupportedException_UnableToBindType(NotSupportedReason.TypeNotDetectedAsInput);
+                Emit_NotSupportedException_TypeNotDetectedAsInput();
                 _writer.WriteBlockEnd();
             }
 
@@ -833,8 +833,8 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                     """);
             }
 
-            private void Emit_NotSupportedException_UnableToBindType(string reason, string typeDisplayString = "{typeof(T)}") =>
-                _writer.WriteLine(@$"throw new global::System.NotSupportedException($""{string.Format(ExceptionMessages.TypeNotSupported, typeDisplayString, reason)}"");");
+            private void Emit_NotSupportedException_TypeNotDetectedAsInput() =>
+                _writer.WriteLine(@$"throw new global::System.NotSupportedException($""{string.Format(ExceptionMessages.TypeNotDetectedAsInput, "{typeof(T)}")}"");");
 
             private void EmitCheckForNullArgument_WithBlankLine_IfRequired(bool isValueType)
             {
index 1dd35c4418d1895fbac73a1521a7992dfcc87dc8..ee6331a8bbe79f101d89eb3d85d38466e3a45e30 100644 (file)
@@ -8,15 +8,14 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 {
     public sealed partial class ConfigurationBindingSourceGenerator
     {
-        private const string GeneratorProjectName = "Microsoft.Extensions.Configuration.Binder.SourceGeneration";
-
-        private static DiagnosticDescriptor TypeNotSupported { get; } = new DiagnosticDescriptor(
-            id: "SYSLIB1100",
-            title: new LocalizableResourceString(nameof(SR.TypeNotSupportedTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
-            messageFormat: new LocalizableResourceString(nameof(SR.TypeNotSupportedMessageFormat), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
-            category: GeneratorProjectName,
-            defaultSeverity: DiagnosticSeverity.Warning,
-            isEnabledByDefault: true);
+        private static DiagnosticDescriptor TypeNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.TypeNotSupported));
+        private static DiagnosticDescriptor AbstractOrInterfaceNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.AbstractOrInterfaceNotSupported));
+        private static DiagnosticDescriptor NeedPublicParameterlessConstructor { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.NeedPublicParameterlessConstructor));
+        private static DiagnosticDescriptor CollectionNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.CollectionNotSupported));
+        private static DiagnosticDescriptor DictionaryKeyNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.DictionaryKeyNotSupported));
+        private static DiagnosticDescriptor ElementTypeNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.ElementTypeNotSupported));
+        private static DiagnosticDescriptor MultiDimArraysNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.MultiDimArraysNotSupported));
+        private static DiagnosticDescriptor NullableUnderlyingTypeNotSupported { get; } = CreateTypeNotSupportedDescriptor(nameof(SR.NullableUnderlyingTypeNotSupported));
 
         private static DiagnosticDescriptor PropertyNotSupported { get; } = new DiagnosticDescriptor(
             id: "SYSLIB1101",
@@ -34,18 +33,14 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
             defaultSeverity: DiagnosticSeverity.Error,
             isEnabledByDefault: true);
 
-        private static class NotSupportedReason
-        {
-            public const string AbstractOrInterfaceNotSupported = "Abstract or interface types are not supported";
-            public const string NeedPublicParameterlessConstructor = "Only objects with public parameterless ctors are supported";
-            public const string CollectionNotSupported = "The collection type is not supported";
-            public const string DictionaryKeyNotSupported = "The dictionary key type is not supported";
-            public const string ElementTypeNotSupported = "The collection element type is not supported";
-            public const string MultiDimArraysNotSupported = "Multidimensional arrays are not supported.";
-            public const string NullableUnderlyingTypeNotSupported = "Nullable underlying type is not supported";
-            public const string TypeNotDetectedAsInput = "Generator parser did not detect the type as input";
-            public const string TypeNotSupported = "The type is not supported";
-        }
+        private static DiagnosticDescriptor CreateTypeNotSupportedDescriptor(string nameofLocalizableMessageFormat) =>
+            new DiagnosticDescriptor(
+            id: "SYSLIB1100",
+            title: new LocalizableResourceString(nameof(SR.TypeNotSupportedTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
+            messageFormat: new LocalizableResourceString(nameofLocalizableMessageFormat, SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
+            category: GeneratorProjectName,
+            defaultSeverity: DiagnosticSeverity.Warning,
+            isEnabledByDefault: true);
 
         private static class Identifier
         {
index 077bf0f4f0b4882b5797388575e57fdfe85db839..d2aa2f79ba7261d4d78e9a13d8a81b07abbb2856 100644 (file)
@@ -7,7 +7,6 @@ using System.Collections.Immutable;
 using System.Diagnostics;
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
-using System.Runtime.InteropServices.ComTypes;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.Operations;
 
@@ -210,7 +209,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                     genericType.ConstructUnboundGenericType() is INamedTypeSymbol { } unboundGeneric &&
                     unboundGeneric.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
                 {
-                    return TryGetTypeSpec(genericType.TypeArguments[0], NotSupportedReason.NullableUnderlyingTypeNotSupported, out TypeSpec? underlyingType)
+                    return TryGetTypeSpec(genericType.TypeArguments[0], NullableUnderlyingTypeNotSupported, out TypeSpec? underlyingType)
                         ? CacheSpec(new NullableSpec(type) { Location = location, UnderlyingType = underlyingType })
                         : null;
                 }
@@ -266,7 +265,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                     return CacheSpec(spec);
                 }
 
-                ReportUnsupportedType(type, NotSupportedReason.TypeNotSupported, location);
+                ReportUnsupportedType(type, TypeNotSupported, location);
                 return null;
 
                 T CacheSpec<T>(T? s) where T : TypeSpec
@@ -398,13 +397,13 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                 }
             }
 
-            private bool TryGetTypeSpec(ITypeSymbol type, string unsupportedReason, out TypeSpec? spec)
+            private bool TryGetTypeSpec(ITypeSymbol type, DiagnosticDescriptor descriptor, out TypeSpec? spec)
             {
                 spec = GetOrCreateTypeSpec(type);
 
                 if (spec == null)
                 {
-                    ReportUnsupportedType(type, unsupportedReason);
+                    ReportUnsupportedType(type, descriptor);
                     return false;
                 }
 
@@ -413,7 +412,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 
             private ArraySpec? CreateArraySpec(IArrayTypeSymbol arrayType, Location? location)
             {
-                if (!TryGetTypeSpec(arrayType.ElementType, NotSupportedReason.ElementTypeNotSupported, out TypeSpec elementSpec))
+                if (!TryGetTypeSpec(arrayType.ElementType, ElementTypeNotSupported, out TypeSpec elementSpec))
                 {
                     return null;
                 }
@@ -441,7 +440,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 
                 if (arrayType.Rank > 1)
                 {
-                    ReportUnsupportedType(arrayType, NotSupportedReason.MultiDimArraysNotSupported, location);
+                    ReportUnsupportedType(arrayType, MultiDimArraysNotSupported, location);
                     elementType = null;
                     return false;
                 }
@@ -466,15 +465,15 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 
             private DictionarySpec CreateDictionarySpec(INamedTypeSymbol type, Location? location, ITypeSymbol keyType, ITypeSymbol elementType)
             {
-                if (!TryGetTypeSpec(keyType, NotSupportedReason.DictionaryKeyNotSupported, out TypeSpec keySpec) ||
-                    !TryGetTypeSpec(elementType, NotSupportedReason.ElementTypeNotSupported, out TypeSpec elementSpec))
+                if (!TryGetTypeSpec(keyType, DictionaryKeyNotSupported, out TypeSpec keySpec) ||
+                    !TryGetTypeSpec(elementType, ElementTypeNotSupported, out TypeSpec elementSpec))
                 {
                     return null;
                 }
 
                 if (keySpec.SpecKind != TypeSpecKind.ParsableFromString)
                 {
-                    ReportUnsupportedType(type, NotSupportedReason.DictionaryKeyNotSupported, location);
+                    ReportUnsupportedType(type, DictionaryKeyNotSupported, location);
                     return null;
                 }
 
@@ -487,7 +486,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                 }
                 else if (!CanConstructObject(type, location) || !HasAddMethod(type, elementType, keyType))
                 {
-                    ReportUnsupportedType(type, NotSupportedReason.CollectionNotSupported, location);
+                    ReportUnsupportedType(type, CollectionNotSupported, location);
                     return null;
                 }
 
@@ -509,7 +508,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 
             private EnumerableSpec? CreateEnumerableSpec(INamedTypeSymbol type, Location? location, ITypeSymbol elementType)
             {
-                if (!TryGetTypeSpec(elementType, NotSupportedReason.ElementTypeNotSupported, out TypeSpec elementSpec))
+                if (!TryGetTypeSpec(elementType, ElementTypeNotSupported, out TypeSpec elementSpec))
                 {
                     return null;
                 }
@@ -526,7 +525,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
                 }
                 else if (!CanConstructObject(type, location) || !HasAddMethod(type, elementType))
                 {
-                    ReportUnsupportedType(type, NotSupportedReason.CollectionNotSupported, location);
+                    ReportUnsupportedType(type, CollectionNotSupported, location);
                     return null;
                 }
 
@@ -687,12 +686,12 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
             {
                 if (type.IsAbstract || type.TypeKind == TypeKind.Interface)
                 {
-                    ReportUnsupportedType(type, NotSupportedReason.AbstractOrInterfaceNotSupported, location);
+                    ReportUnsupportedType(type, AbstractOrInterfaceNotSupported, location);
                     return false;
                 }
                 else if (!HasPublicParameterlessCtor(type))
                 {
-                    ReportUnsupportedType(type, NotSupportedReason.NeedPublicParameterlessConstructor, location);
+                    ReportUnsupportedType(type, NeedPublicParameterlessConstructor, location);
                     return false;
                 }
 
@@ -752,12 +751,12 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 
             private static bool IsEnum(ITypeSymbol type) => type is INamedTypeSymbol { EnumUnderlyingType: INamedTypeSymbol { } };
 
-            private void ReportUnsupportedType(ITypeSymbol type, string reason, Location? location = null)
+            private void ReportUnsupportedType(ITypeSymbol type, DiagnosticDescriptor descriptor, Location? location = null)
             {
                 if (!_unsupportedTypes.Contains(type))
                 {
                     _context.ReportDiagnostic(
-                        Diagnostic.Create(TypeNotSupported, location, new string[] { type.ToDisplayString(), reason }));
+                        Diagnostic.Create(descriptor, location, new string[] { type.ToDisplayString() }));
                     _unsupportedTypes.Add(type);
                 }
             }
index 46b4ed1789b7e535a829478457b6b667d1872a9f..864037a1c0e19b913e697aa6c01b619e98229775 100644 (file)
@@ -18,6 +18,8 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
     [Generator]
     public sealed partial class ConfigurationBindingSourceGenerator : IIncrementalGenerator
     {
+        private const string GeneratorProjectName = "Microsoft.Extensions.Configuration.Binder.SourceGeneration";
+
         public void Initialize(IncrementalGeneratorInitializationContext context)
         {
             IncrementalValueProvider<CompilationData?> compilationData =
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationSectionTypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationSectionTypeSpec.cs
deleted file mode 100644 (file)
index 533a98c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal sealed record ConfigurationSectionTypeSpec : TypeSpec
-    {
-        public ConfigurationSectionTypeSpec(ITypeSymbol type) : base(type) { }
-        public override TypeSpecKind SpecKind => TypeSpecKind.IConfigurationSection;
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConstructionStrategy.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConstructionStrategy.cs
deleted file mode 100644 (file)
index 21db025..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal enum ConstructionStrategy
-    {
-        NotApplicable = 0,
-        ParameterlessConstructor = 1,
-    }
-}
index d31ed9a78366213e53d1bc60c8cd88a8611d10fe..d50f7242700fa7af0c0f2d6b4827655442bdc7f8 100644 (file)
@@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
     // Runtime exception messages; not localized so we keep them in source.
     internal static class ExceptionMessages
     {
-        public const string TypeNotSupported = "Unable to bind to type '{0}': '{1}'";
+        public const string TypeNotDetectedAsInput = "Unable to bind to type '{0}': generator did not detect the type as input.";
         public const string FailedBinding = "Failed to convert configuration value at '{0}' to type '{1}'.";
     }
 }
index 5b9340c1d16223c4d60b44598b1ef81aca181e72..d9bac84eb7aa6d89eb634bccd52527261dd9b457 100644 (file)
     <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.cs" Link="Production\ValueListBuilder.cs" />
     <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.Pop.cs" Link="Production\ValueListBuilder.Pop.cs" />
     <Compile Include="$(CommonPath)\Roslyn\GetBestTypeByMetadataName.cs" Link="Common\Roslyn\GetBestTypeByMetadataName.cs" />
-    <Compile Include="CollectionSpec.cs" />
     <Compile Include="ConfigurationBindingSourceGenerator.cs" />
     <Compile Include="ConfigurationBindingSourceGenerator.Emitter.cs" />
     <Compile Include="ConfigurationBindingSourceGenerator.Helpers.cs" />
     <Compile Include="ConfigurationBindingSourceGenerator.Parser.cs" />
-    <Compile Include="ConstructionStrategy.cs" />
-    <Compile Include="ConfigurationSectionTypeSpec.cs" />
     <Compile Include="ExceptionMessages.cs" />
     <Compile Include="MethodSpecifier.cs" />
-    <Compile Include="NullableSpec.cs" />
-    <Compile Include="ObjectSpec.cs" />
-    <Compile Include="ParsableFromStringTypeSpec.cs" />
-    <Compile Include="PopulationStrategy.cs" />
-    <Compile Include="PropertySpec.cs" />
     <Compile Include="SourceGenerationSpec.cs" />
     <Compile Include="SourceWriter.cs" />
-    <Compile Include="TypeSpecKind.cs" />
-    <Compile Include="TypeSpec.cs" />
+    <Compile Include="TypeGraph\CollectionSpec.cs" />
+    <Compile Include="TypeGraph\ConstructionStrategy.cs" />
+    <Compile Include="TypeGraph\ConfigurationSectionTypeSpec.cs" />
+    <Compile Include="TypeGraph\NullableSpec.cs" />
+    <Compile Include="TypeGraph\ObjectSpec.cs" />
+    <Compile Include="TypeGraph\ParsableFromStringTypeSpec.cs" />
+    <Compile Include="TypeGraph\PropertySpec.cs" />
+    <Compile Include="TypeGraph\TypeSpecKind.cs" />
+    <Compile Include="TypeGraph\TypeSpec.cs" />
   </ItemGroup>
 </Project>
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/NullableSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/NullableSpec.cs
deleted file mode 100644 (file)
index a75c281..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal sealed record NullableSpec : TypeSpec
-    {
-        public NullableSpec(ITypeSymbol type) : base(type) { }
-        public override TypeSpecKind SpecKind => TypeSpecKind.Nullable;
-        public required TypeSpec UnderlyingType { get; init; }
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ObjectSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ObjectSpec.cs
deleted file mode 100644 (file)
index 63f6f38..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal sealed record ObjectSpec : TypeSpec
-    {
-        public ObjectSpec(INamedTypeSymbol type) : base(type) { }
-        public override TypeSpecKind SpecKind => TypeSpecKind.Object;
-        public List<PropertySpec> Properties { get; } = new();
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ParsableFromStringTypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ParsableFromStringTypeSpec.cs
deleted file mode 100644 (file)
index 96dd5f8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Diagnostics;
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal sealed record ParsableFromStringTypeSpec : TypeSpec
-    {
-        public ParsableFromStringTypeSpec(ITypeSymbol type) : base(type) { }
-
-        public override TypeSpecKind SpecKind => TypeSpecKind.ParsableFromString;
-
-        public required StringParsableTypeKind StringParsableTypeKind { get; init; }
-
-        private string? _parseMethodName;
-        public string ParseMethodName
-        {
-            get
-            {
-                Debug.Assert(StringParsableTypeKind is not StringParsableTypeKind.ConfigValue);
-
-                _parseMethodName ??= StringParsableTypeKind is StringParsableTypeKind.ByteArray
-                    ? "ParseByteArray"
-                    // MinimalDisplayString.Length is certainly > 2.
-                    : $"Parse{(char.ToUpper(MinimalDisplayString[0]) + MinimalDisplayString.Substring(1)).Replace(".", "")}";
-
-                return _parseMethodName;
-            }
-        }
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PopulationStrategy.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PopulationStrategy.cs
deleted file mode 100644 (file)
index 05ba9e9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal enum PopulationStrategy
-    {
-        NotApplicable = 0,
-        Indexer = 1,
-        Add = 2,
-        Push = 3,
-        Enqueue = 4,
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PropertySpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/PropertySpec.cs
deleted file mode 100644 (file)
index 13a83fa..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Linq;
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal sealed record PropertySpec
-    {
-        public PropertySpec(IPropertySymbol property)
-        {
-            Name = property.Name;
-            IsStatic = property.IsStatic;
-            CanGet = property.GetMethod is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, IsInitOnly: false };
-            CanSet = property.SetMethod is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, IsInitOnly: false };
-        }
-
-        public string Name { get; }
-        public bool IsStatic { get; }
-        public bool CanGet { get; }
-        public bool CanSet { get; }
-        public required TypeSpec Type { get; init; }
-        public required string ConfigurationKeyName { get; init; }
-    }
-}
index 7ea9c596dd90de07f26ba893c7ed5396358d49dd..9bfb27cfa2030f303a459fb81ceb4ef81dd77ab8 100644 (file)
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="AbstractOrInterfaceNotSupported" xml:space="preserve">
+    <value>Abstract or interface types are not supported: '{0}'.</value>
+  </data>
+  <data name="CollectionNotSupported" xml:space="preserve">
+    <value>The collection type is not supported: '{0}'.</value>
+  </data>
+  <data name="DictionaryKeyNotSupported" xml:space="preserve">
+    <value>The dictionary key type is not supported: '{0}'.</value>
+  </data>
+  <data name="ElementTypeNotSupported" xml:space="preserve">
+    <value>The collection element type is not supported: '{0}'.</value>
+  </data>
   <data name="Language VersionIsNotSupportedMessageFormat" xml:space="preserve">
     <value>The project's language version has to be at least 'C# 11'.</value>
   </data>
   <data name="LanguageVersionIsNotSupportedTitle" xml:space="preserve">
     <value>Language version is required to be at least C# 11</value>
   </data>
+  <data name="MultiDimArraysNotSupported" xml:space="preserve">
+    <value>Multidimensional arrays are not supported: '{0}'.</value>
+  </data>
+  <data name="NeedPublicParameterlessConstructor" xml:space="preserve">
+    <value>Only objects with public parameterless constructors are supported: '{0}'.</value>
+  </data>
+  <data name="NullableUnderlyingTypeNotSupported" xml:space="preserve">
+    <value>Nullable underlying type is not supported: '{0}'.</value>
+  </data>
   <data name="PropertyNotSupportedMessageFormat" xml:space="preserve">
     <value>Property '{0}' on type '{1}' is not supported.</value>
   </data>
   <data name="PropertyNotSupportedTitle" xml:space="preserve">
     <value>Did not generate binding logic for a property on a type</value>
   </data>
-  <data name="TypeNotSupportedMessageFormat" xml:space="preserve">
-    <value>Type '{0}' is not supported: {1}.</value>
+  <data name="TypeNotSupported" xml:space="preserve">
+    <value>The type is not supported: '{0}'.</value>
   </data>
   <data name="TypeNotSupportedTitle" xml:space="preserve">
     <value>Did not generate binding logic for a type</value>
index c2a1d5dd9a934e68919ca9362f2d10381e6291f7..3cfe859b25076a5134abe74e5a47baa5b5c93b19 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="cs" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">Jazyková verze projektu musí být alespoň C# 11</target>
         <target state="translated">Verze jazyka musí být alespoň C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">Vlastnost „{0}“ u typu „{1}“ se nepodporuje.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Negenerovala se logika vazby pro vlastnost typu</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Typ „{0}“ se nepodporuje: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 806c78c7142cfe44b4c6a3fd72bbd9f815d3176b..fb7274ed494b911d1fdfd27349750ff6ea23a41c 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="de" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">Die Sprachversion des Projekts muss mindestens „C# 11“ sein</target>
         <target state="translated">Die Sprachversion muss mindestens C# 11 sein</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">Die Eigenschaft „{0}“ für den Typ „{1}“ wird nicht unterstützt.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Für eine Eigenschaft eines Typs wurde keine Bindungslogik generiert</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Der Typ „{0}“ wird nicht unterstützt: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index c93076fabceb11e81a030305e49f5c4f4a155dbe..b4c2cffb8501dc795e853bc8c809c30196e2f2a1 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="es" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">La versión del lenguaje del proyecto debe ser al menos "C# 11".</target>
         <target state="translated">La versión del lenguaje debe ser al menos C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">La propiedad '{0}' en el tipo '{1}' no se admite.</target>
@@ -22,9 +57,9 @@
         <target state="translated">No se ha generado la lógica de enlace para una propiedad en un tipo.</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">El tipo '{0}' no se admite: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 178e5bedc42774e9a8b9084766b4c9773fe20917..5c60230567a9702a87acf68334e8e44f86dca661 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="fr" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">La version de langage du projet doit être au moins « C# 11 ».</target>
         <target state="translated">La version du langage doit être au moins C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">La propriété '{0}' sur le type '{1}' n’est pas prise en charge.</target>
@@ -22,9 +57,9 @@
         <target state="translated">La logique de liaison n’a pas été généré pour une propriété sur un type</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Le type '{0}' n’est pas pris en charge : {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index aec05f57f9fd2cb0d19c9fce50c39705960abdaa..7b1ad520477f19d83b698c87956d725e4a102e7c 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="it" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">La versione del linguaggio del progetto deve essere almeno 'C# 11'.</target>
         <target state="translated">La versione del linguaggio deve essere almeno C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">La proprietà '{0}' nel tipo '{1}' non è supportata.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Non è stata generata la logica di binding per una proprietà in un tipo</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Il tipo '{0}' non è supportato: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index cf0ed49380f3ecc9125db5d11701205a3eb18968..a9bbbf3b34b2acd6e3fb05cce445e57b42ded461 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="ja" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">プロジェクトの言語バージョンは少なくとも 'C# 11' である必要があります。</target>
         <target state="translated">言語バージョンは少なくとも C# 11 である必要があります</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">型 '{1}' のプロパティ '{0}' はサポートされていません。</target>
@@ -22,9 +57,9 @@
         <target state="translated">型のプロパティのバインディング ロジックを生成しませんでした</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">型 '{0}' はサポートされていません: {1}。</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 832f244d02505cb49877c26261827244b04601c4..720a859a1cbadaa5627fbdd466e8953006ba3dbc 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="ko" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">프로젝트의 언어 버전은 'C# 11' 이상이어야 합니다.</target>
         <target state="translated">언어 버전은 C# 11 이상이어야 합니다.</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">'{1}' 형식의 속성 '{0}'은(는) 지원되지 않습니다.</target>
@@ -22,9 +57,9 @@
         <target state="translated">형식의 속성에 대한 바인딩 논리를 생성하지 않았습니다.</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">'{0}' 형식은 지원되지 않습니다. {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 471337318f873a3f84f3254354dc450fcf27c171..9a3d58f0600c213273968d4e5c79d182eb70c4f7 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="pl" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">Wersja językowa projektu musi mieć wartość co najmniej „C# 11”.</target>
         <target state="translated">Wymagana jest wersja językowa co najmniej C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">Właściwość „{0}” w typie „{1}” nie jest obsługiwana.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Nie wygenerowano logiki powiązania dla właściwości w typie</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Typ „{0}” nie jest obsługiwany: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index f45365bd58ee4d8996baf11fd081d5533d3e08a1..3f8430df07fefce00dbe86e1e8c02dc7f0aa25b7 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="pt-BR" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">A versão do idioma do projeto deve ser no mínimo 'C# 11'.</target>
         <target state="translated">A versão do idioma deve ser pelo menos C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">Não há suporte para a propriedade '{0}' no tipo '{1}'.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Não gerou lógica de ligação para uma propriedade em um tipo</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Não há suporte para o tipo '{0}': {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 28401e9e9acd293e5d49208296e59b72eb5aabc0..36809578fd03e4251a7f0c17f946f62754c2325b 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="ru" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">Версия языка проекта должна быть не ниже "C# 11".</target>
         <target state="translated">Версия языка должна быть не ниже C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">Свойство "{0}" типа "{1}" не поддерживается.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Не создана логика привязки для свойства типа</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">Тип "{0}" не поддерживается: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 24ce4b5933ac7573bd90ee9ad53e63d49e671200..aa91ffdf1440f7ae4baac18564e2f6925320007c 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="tr" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">Projenin dil sürümü en az 'C# 11' olmalıdır.</target>
         <target state="translated">Dil sürümünün en az C# 11 olması gerekir</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">'{1}' türündeki '{0}' özelliği desteklenmiyor.</target>
@@ -22,9 +57,9 @@
         <target state="translated">Türdeki bir özellik için bağlama mantığı oluşturulmadı</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">'{0}' türü desteklenmiyor: {1}.</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 7521008371b5e4a2a994ced3383b8b27be8b3f73..a3d4c35b548bee868d94e52d180b91f3a7382fa4 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="zh-Hans" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">项目的语言版本必须至少为 "C# 11"。</target>
         <target state="translated">语言版本必须至少为 C# 11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">类型“{1}”中的属性“{0}”不受支持。</target>
@@ -22,9 +57,9 @@
         <target state="translated">没有为类型中的属性生成绑定逻辑</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">类型“{0}”不受支持:{1}。</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index 6a49ca9498fc05c5fe38220996c0645525a750ce..07aa56d28c2b3a3530d565e7404be23519544a46 100644 (file)
@@ -2,6 +2,26 @@
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
   <file datatype="xml" source-language="en" target-language="zh-Hant" original="../Strings.resx">
     <body>
+      <trans-unit id="AbstractOrInterfaceNotSupported">
+        <source>Abstract or interface types are not supported: '{0}'.</source>
+        <target state="new">Abstract or interface types are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="CollectionNotSupported">
+        <source>The collection type is not supported: '{0}'.</source>
+        <target state="new">The collection type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="DictionaryKeyNotSupported">
+        <source>The dictionary key type is not supported: '{0}'.</source>
+        <target state="new">The dictionary key type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="ElementTypeNotSupported">
+        <source>The collection element type is not supported: '{0}'.</source>
+        <target state="new">The collection element type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="Language VersionIsNotSupportedMessageFormat">
         <source>The project's language version has to be at least 'C# 11'.</source>
         <target state="translated">專案的語言版本必須至少為 'C# 11'。</target>
         <target state="translated">語言版本要求至少為 C#11</target>
         <note />
       </trans-unit>
+      <trans-unit id="MultiDimArraysNotSupported">
+        <source>Multidimensional arrays are not supported: '{0}'.</source>
+        <target state="new">Multidimensional arrays are not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NeedPublicParameterlessConstructor">
+        <source>Only objects with public parameterless constructors are supported: '{0}'.</source>
+        <target state="new">Only objects with public parameterless constructors are supported: '{0}'.</target>
+        <note />
+      </trans-unit>
+      <trans-unit id="NullableUnderlyingTypeNotSupported">
+        <source>Nullable underlying type is not supported: '{0}'.</source>
+        <target state="new">Nullable underlying type is not supported: '{0}'.</target>
+        <note />
+      </trans-unit>
       <trans-unit id="PropertyNotSupportedMessageFormat">
         <source>Property '{0}' on type '{1}' is not supported.</source>
         <target state="translated">不支援類型 '{1}' 的屬性 '{0}'。</target>
@@ -22,9 +57,9 @@
         <target state="translated">未在類型上產生屬性的繫結邏輯</target>
         <note />
       </trans-unit>
-      <trans-unit id="TypeNotSupportedMessageFormat">
-        <source>Type '{0}' is not supported: {1}.</source>
-        <target state="translated">不支援類型 '{0}': {1}。</target>
+      <trans-unit id="TypeNotSupported">
+        <source>The type is not supported: '{0}'.</source>
+        <target state="new">The type is not supported: '{0}'.</target>
         <note />
       </trans-unit>
       <trans-unit id="TypeNotSupportedTitle">
index f4964c5ba999329bb537b4ac8a81a1908cce2a8c..79ab04a5da809158e5176a741ddc5dc7cd8bd60b 100644 (file)
@@ -2,11 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Collections.Generic;
-using Microsoft.CodeAnalysis;
 
 namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
 {
-
     internal sealed record SourceGenerationSpec(
         Dictionary<MethodSpecifier, HashSet<TypeSpec>> RootConfigTypes,
         MethodSpecifier MethodsToGen,
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/CollectionSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/CollectionSpec.cs
new file mode 100644 (file)
index 0000000..f86f668
--- /dev/null
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal abstract record CollectionSpec : TypeSpec
+    {
+        public CollectionSpec(ITypeSymbol type) : base(type)
+        {
+            IsReadOnly = type.IsReadOnly;
+            IsInterface = type is INamedTypeSymbol { TypeKind: TypeKind.Interface };
+        }
+
+        public required TypeSpec ElementType { get; init; }
+
+        public bool IsReadOnly { get; }
+
+        public bool IsInterface { get; }
+
+        public CollectionSpec? ConcreteType { get; init; }
+    }
+
+    internal sealed record ArraySpec : CollectionSpec
+    {
+        public ArraySpec(ITypeSymbol type) : base(type) { }
+
+        public override TypeSpecKind SpecKind => TypeSpecKind.Array;
+    }
+
+    internal sealed record EnumerableSpec : CollectionSpec
+    {
+        public EnumerableSpec(ITypeSymbol type) : base(type) { }
+
+        public override TypeSpecKind SpecKind => TypeSpecKind.Enumerable;
+    }
+
+    internal sealed record DictionarySpec : CollectionSpec
+    {
+        public DictionarySpec(INamedTypeSymbol type) : base(type) { }
+
+        public override TypeSpecKind SpecKind => TypeSpecKind.Dictionary;
+
+        public required ParsableFromStringTypeSpec KeyType { get; init; }
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConfigurationSectionTypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConfigurationSectionTypeSpec.cs
new file mode 100644 (file)
index 0000000..533a98c
--- /dev/null
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal sealed record ConfigurationSectionTypeSpec : TypeSpec
+    {
+        public ConfigurationSectionTypeSpec(ITypeSymbol type) : base(type) { }
+        public override TypeSpecKind SpecKind => TypeSpecKind.IConfigurationSection;
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConstructionStrategy.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ConstructionStrategy.cs
new file mode 100644 (file)
index 0000000..21db025
--- /dev/null
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal enum ConstructionStrategy
+    {
+        NotApplicable = 0,
+        ParameterlessConstructor = 1,
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/NullableSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/NullableSpec.cs
new file mode 100644 (file)
index 0000000..a75c281
--- /dev/null
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal sealed record NullableSpec : TypeSpec
+    {
+        public NullableSpec(ITypeSymbol type) : base(type) { }
+        public override TypeSpecKind SpecKind => TypeSpecKind.Nullable;
+        public required TypeSpec UnderlyingType { get; init; }
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ObjectSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ObjectSpec.cs
new file mode 100644 (file)
index 0000000..63f6f38
--- /dev/null
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal sealed record ObjectSpec : TypeSpec
+    {
+        public ObjectSpec(INamedTypeSymbol type) : base(type) { }
+        public override TypeSpecKind SpecKind => TypeSpecKind.Object;
+        public List<PropertySpec> Properties { get; } = new();
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ParsableFromStringTypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/ParsableFromStringTypeSpec.cs
new file mode 100644 (file)
index 0000000..96dd5f8
--- /dev/null
@@ -0,0 +1,33 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Diagnostics;
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal sealed record ParsableFromStringTypeSpec : TypeSpec
+    {
+        public ParsableFromStringTypeSpec(ITypeSymbol type) : base(type) { }
+
+        public override TypeSpecKind SpecKind => TypeSpecKind.ParsableFromString;
+
+        public required StringParsableTypeKind StringParsableTypeKind { get; init; }
+
+        private string? _parseMethodName;
+        public string ParseMethodName
+        {
+            get
+            {
+                Debug.Assert(StringParsableTypeKind is not StringParsableTypeKind.ConfigValue);
+
+                _parseMethodName ??= StringParsableTypeKind is StringParsableTypeKind.ByteArray
+                    ? "ParseByteArray"
+                    // MinimalDisplayString.Length is certainly > 2.
+                    : $"Parse{(char.ToUpper(MinimalDisplayString[0]) + MinimalDisplayString.Substring(1)).Replace(".", "")}";
+
+                return _parseMethodName;
+            }
+        }
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/PropertySpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/PropertySpec.cs
new file mode 100644 (file)
index 0000000..13a83fa
--- /dev/null
@@ -0,0 +1,26 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Linq;
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal sealed record PropertySpec
+    {
+        public PropertySpec(IPropertySymbol property)
+        {
+            Name = property.Name;
+            IsStatic = property.IsStatic;
+            CanGet = property.GetMethod is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, IsInitOnly: false };
+            CanSet = property.SetMethod is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, IsInitOnly: false };
+        }
+
+        public string Name { get; }
+        public bool IsStatic { get; }
+        public bool CanGet { get; }
+        public bool CanSet { get; }
+        public required TypeSpec Type { get; init; }
+        public required string ConfigurationKeyName { get; init; }
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpec.cs
new file mode 100644 (file)
index 0000000..d4da7d1
--- /dev/null
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal abstract record TypeSpec
+    {
+        private static readonly SymbolDisplayFormat s_minimalDisplayFormat = new SymbolDisplayFormat(
+            globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+            typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypes,
+            genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
+            miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+
+        public TypeSpec(ITypeSymbol type)
+        {
+            FullyQualifiedDisplayString = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
+            MinimalDisplayString = type.ToDisplayString(s_minimalDisplayFormat);
+            Namespace = type.ContainingNamespace?.ToDisplayString();
+            IsValueType = type.IsValueType;
+        }
+
+        public string FullyQualifiedDisplayString { get; }
+
+        public string MinimalDisplayString { get; }
+
+        public string? Namespace { get; }
+
+        public bool IsValueType { get; }
+
+        public abstract TypeSpecKind SpecKind { get; }
+
+        public virtual ConstructionStrategy ConstructionStrategy { get; init; }
+
+        /// <summary>
+        /// Where in the input compilation we picked up a call to Bind, Get, or Configure.
+        /// </summary>
+        public required Location? Location { get; init; }
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpecKind.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeGraph/TypeSpecKind.cs
new file mode 100644 (file)
index 0000000..dcfc27b
--- /dev/null
@@ -0,0 +1,31 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
+{
+    internal enum TypeSpecKind
+    {
+        Unknown = 0,
+        ParsableFromString = 1,
+        Object = 2,
+        Array = 3,
+        Enumerable = 4,
+        Dictionary = 5,
+        IConfigurationSection = 6,
+        Nullable = 7,
+    }
+
+    internal enum StringParsableTypeKind
+    {
+        None = 0,
+        ConfigValue = 1,
+        Enum = 2,
+        ByteArray = 3,
+        Integer = 4,
+        Float = 5,
+        Parse = 6,
+        ParseInvariant = 7,
+        CultureInfo = 8,
+        Uri = 9,
+    }
+}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpec.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpec.cs
deleted file mode 100644 (file)
index d4da7d1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Microsoft.CodeAnalysis;
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal abstract record TypeSpec
-    {
-        private static readonly SymbolDisplayFormat s_minimalDisplayFormat = new SymbolDisplayFormat(
-            globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
-            typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypes,
-            genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
-            miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
-
-        public TypeSpec(ITypeSymbol type)
-        {
-            FullyQualifiedDisplayString = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
-            MinimalDisplayString = type.ToDisplayString(s_minimalDisplayFormat);
-            Namespace = type.ContainingNamespace?.ToDisplayString();
-            IsValueType = type.IsValueType;
-        }
-
-        public string FullyQualifiedDisplayString { get; }
-
-        public string MinimalDisplayString { get; }
-
-        public string? Namespace { get; }
-
-        public bool IsValueType { get; }
-
-        public abstract TypeSpecKind SpecKind { get; }
-
-        public virtual ConstructionStrategy ConstructionStrategy { get; init; }
-
-        /// <summary>
-        /// Where in the input compilation we picked up a call to Bind, Get, or Configure.
-        /// </summary>
-        public required Location? Location { get; init; }
-    }
-}
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpecKind.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/gen/TypeSpecKind.cs
deleted file mode 100644 (file)
index dcfc27b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration
-{
-    internal enum TypeSpecKind
-    {
-        Unknown = 0,
-        ParsableFromString = 1,
-        Object = 2,
-        Array = 3,
-        Enumerable = 4,
-        Dictionary = 5,
-        IConfigurationSection = 6,
-        Nullable = 7,
-    }
-
-    internal enum StringParsableTypeKind
-    {
-        None = 0,
-        ConfigValue = 1,
-        Enum = 2,
-        ByteArray = 3,
-        Integer = 4,
-        Float = 5,
-        Parse = 6,
-        ParseInvariant = 7,
-        CultureInfo = 8,
-        Uri = 9,
-    }
-}
index 735f5247fedd7d99b4a933d9ebb35ad1260f886d..a612cb0f046b09afafffd58cecb57fe68e25b4e6 100644 (file)
@@ -23,7 +23,7 @@ internal static class GeneratedConfigurationBinder
             });
         }
 
-        throw new global::System.NotSupportedException($"Unable to bind to type '{typeof(T)}': 'Generator parser did not detect the type as input'");
+        throw new global::System.NotSupportedException($"Unable to bind to type '{typeof(T)}': generator did not detect the type as input.");
     }
 }
 
index bdb48ea091890d4a2acead71c0f7a5a1350c0476..3875d08ca5f0db3b1a2bb3c33ee6591f89db89a2 100644 (file)
@@ -22,7 +22,7 @@ internal static class GeneratedConfigurationBinder
             return (T)(object)obj;
         }
 
-        throw new global::System.NotSupportedException($"Unable to bind to type '{typeof(T)}': 'Generator parser did not detect the type as input'");
+        throw new global::System.NotSupportedException($"Unable to bind to type '{typeof(T)}': generator did not detect the type as input.");
     }
 }