Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Arnott <andrew.arnott@microsoft.com>2022-06-09 16:28:58 +0300
committerAndrew Arnott <andrew.arnott@microsoft.com>2022-06-09 16:28:58 +0300
commit7e1629eeeb3fbe6276302e958a43e79446d36e63 (patch)
tree940542bea022c1aacddeb866af675da2627d06eb
parent623aaf27bcbb254f2e5e02c6c37ddb1a650df31f (diff)
parent9f5b50634c08879476ad877cd599a77290bb19a3 (diff)
Merge branch 'master' into mergeMasterToDevelop
-rw-r--r--README.md31
-rw-r--r--sandbox/Sandbox/Generated.cs11
-rw-r--r--sandbox/TestData2/Generated.cs3
-rw-r--r--src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs7
-rw-r--r--src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt1
-rw-r--r--src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs7
-rw-r--r--src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt1
-rw-r--r--src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs7
-rw-r--r--src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt1
-rw-r--r--src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs7
-rw-r--r--src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt1
-rw-r--r--src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs7
-rw-r--r--src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt1
-rw-r--r--src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta11
14 files changed, 64 insertions, 32 deletions
diff --git a/README.md b/README.md
index 77d2c655..27af11f5 100644
--- a/README.md
+++ b/README.md
@@ -1132,7 +1132,7 @@ Here is an example of such a custom formatter implementation. Note its use of th
```csharp
/// <summary>Serializes a <see cref="FileInfo" /> by its full path as a string.</summary>
-public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
+public class FileInfoFormatter : IMessagePackFormatter<FileInfo>
{
public void Serialize(
ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options)
@@ -1175,7 +1175,7 @@ you must precede it with a map or array header. You must read the entire map/arr
For example:
```csharp
-public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject>
+public class MySpecialObjectFormatter : IMessagePackFormatter<MySpecialObject>
{
public void Serialize(
ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options)
@@ -1213,15 +1213,18 @@ public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject
int count = reader.ReadArrayHeader();
for (int i = 0; i < count; i++)
{
- case 0:
- fullName = reader.ReadString();
- break;
- case 1:
- age = reader.ReadInt32();
- break;
- default:
- reader.Skip();
- break;
+ switch (i)
+ {
+ case 0:
+ fullName = reader.ReadString();
+ break;
+ case 1:
+ age = reader.ReadInt32();
+ break;
+ default:
+ reader.Skip();
+ break;
+ }
}
reader.Depth--;
@@ -1406,12 +1409,6 @@ internal static class SampleCustomResolverGetFormatterHelper
return formatter;
}
- // If target type is generics, use MakeGenericType.
- if (t.IsGeneric && t.GetGenericTypeDefinition() == typeof(ValueTuple<,>))
- {
- return Activator.CreateInstance(typeof(ValueTupleFormatter<,>).MakeGenericType(t.GenericTypeArguments));
- }
-
// If type can not get, must return null for fallback mechanism.
return null;
}
diff --git a/sandbox/Sandbox/Generated.cs b/sandbox/Sandbox/Generated.cs
index 9b5c623c..bc3bcd7a 100644
--- a/sandbox/Sandbox/Generated.cs
+++ b/sandbox/Sandbox/Generated.cs
@@ -6,6 +6,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
@@ -228,6 +229,7 @@ namespace MessagePack.Resolvers
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -265,6 +267,7 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -303,6 +306,7 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -419,6 +423,7 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -884,6 +889,7 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -958,6 +964,7 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1345,6 +1352,7 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1587,6 +1595,7 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1734,6 +1743,7 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -3819,6 +3829,7 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
diff --git a/sandbox/TestData2/Generated.cs b/sandbox/TestData2/Generated.cs
index e4f08ad5..1e65486d 100644
--- a/sandbox/TestData2/Generated.cs
+++ b/sandbox/TestData2/Generated.cs
@@ -6,6 +6,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
@@ -112,6 +113,7 @@ namespace MessagePack.Resolvers
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -164,6 +166,7 @@ namespace MessagePack.Formatters.TestData2
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
diff --git a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs
index 66c9fc14..382112a3 100644
--- a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs
+++ b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version: 16.0.0.0
+// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
/// <summary>
/// Class to produce the template output
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class EnumTemplate : EnumTemplateBase
{
/// <summary>
@@ -33,6 +33,7 @@ namespace MessagePackCompiler.Generator
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -77,7 +78,7 @@ namespace ");
/// <summary>
/// Base class for this transformation
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class EnumTemplateBase
{
#region Fields
diff --git a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt
index d9fda115..74214c6c 100644
--- a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt
+++ b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt
@@ -11,6 +11,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
diff --git a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs
index dfb84caf..396d6a52 100644
--- a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs
+++ b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version: 16.0.0.0
+// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
/// <summary>
/// Class to produce the template output
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class FormatterTemplate : FormatterTemplateBase
{
/// <summary>
@@ -33,6 +33,7 @@ namespace MessagePackCompiler.Generator
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -226,7 +227,7 @@ namespace ");
/// <summary>
/// Base class for this transformation
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class FormatterTemplateBase
{
#region Fields
diff --git a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt
index bf96d9e5..240b107f 100644
--- a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt
+++ b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt
@@ -11,6 +11,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
diff --git a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs
index c433e545..58f20711 100644
--- a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs
+++ b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version: 16.0.0.0
+// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
/// <summary>
/// Class to produce the template output
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ResolverTemplate : ResolverTemplateBase
{
/// <summary>
@@ -33,6 +33,7 @@ namespace MessagePackCompiler.Generator
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
@@ -130,7 +131,7 @@ namespace ");
/// <summary>
/// Base class for this transformation
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class ResolverTemplateBase
{
#region Fields
diff --git a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt
index 1fcd9839..6837185d 100644
--- a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt
+++ b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt
@@ -11,6 +11,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
diff --git a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs
index d598c202..abc89f78 100644
--- a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs
+++ b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version: 16.0.0.0
+// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
/// <summary>
/// Class to produce the template output
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class StringKeyFormatterTemplate : StringKeyFormatterTemplateBase
{
/// <summary>
@@ -33,6 +33,7 @@ namespace MessagePackCompiler.Generator
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -212,7 +213,7 @@ foreach (var objInfo in ObjectSerializationInfos) {
/// <summary>
/// Base class for this transformation
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class StringKeyFormatterTemplateBase
{
#region Fields
diff --git a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt
index 296ef454..9f0dac87 100644
--- a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt
+++ b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt
@@ -12,6 +12,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
#pragma warning disable SA1309 // Field names should not begin with underscore
diff --git a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs
index 6ea73cff..b7a639bf 100644
--- a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs
+++ b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version: 16.0.0.0
+// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
/// <summary>
/// Class to produce the template output
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class UnionTemplate : UnionTemplateBase
{
/// <summary>
@@ -33,6 +33,7 @@ namespace MessagePackCompiler.Generator
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
@@ -152,7 +153,7 @@ namespace ");
/// <summary>
/// Base class for this transformation
/// </summary>
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class UnionTemplateBase
{
#region Fields
diff --git a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt
index 174dd3d2..eb9272d0 100644
--- a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt
+++ b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt
@@ -11,6 +11,7 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta
new file mode 100644
index 00000000..1f34c5ff
--- /dev/null
+++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d4e2e1ebcc7467944a57bb9a3327820b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: