Skip to content

Commit 69d190d

Browse files
authored
Merge pull request MessagePack-CSharp#1443 from AArnott/mergeMasterToDevelop
Merge master to develop
2 parents 623aaf2 + 7e1629e commit 69d190d

File tree

14 files changed

+64
-32
lines changed

14 files changed

+64
-32
lines changed

README.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ Here is an example of such a custom formatter implementation. Note its use of th
11321132

11331133
```csharp
11341134
/// <summary>Serializes a <see cref="FileInfo" /> by its full path as a string.</summary>
1135-
public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
1135+
public class FileInfoFormatter : IMessagePackFormatter<FileInfo>
11361136
{
11371137
public void Serialize(
11381138
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
11751175
For example:
11761176

11771177
```csharp
1178-
public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject>
1178+
public class MySpecialObjectFormatter : IMessagePackFormatter<MySpecialObject>
11791179
{
11801180
public void Serialize(
11811181
ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options)
@@ -1213,15 +1213,18 @@ public class MySpecialObjectFormatter<T> : IMessagePackFormatter<MySpecialObject
12131213
int count = reader.ReadArrayHeader();
12141214
for (int i = 0; i < count; i++)
12151215
{
1216-
case 0:
1217-
fullName = reader.ReadString();
1218-
break;
1219-
case 1:
1220-
age = reader.ReadInt32();
1221-
break;
1222-
default:
1223-
reader.Skip();
1224-
break;
1216+
switch (i)
1217+
{
1218+
case 0:
1219+
fullName = reader.ReadString();
1220+
break;
1221+
case 1:
1222+
age = reader.ReadInt32();
1223+
break;
1224+
default:
1225+
reader.Skip();
1226+
break;
1227+
}
12251228
}
12261229

12271230
reader.Depth--;
@@ -1406,12 +1409,6 @@ internal static class SampleCustomResolverGetFormatterHelper
14061409
return formatter;
14071410
}
14081411

1409-
// If target type is generics, use MakeGenericType.
1410-
if (t.IsGeneric && t.GetGenericTypeDefinition() == typeof(ValueTuple<,>))
1411-
{
1412-
return Activator.CreateInstance(typeof(ValueTupleFormatter<,>).MakeGenericType(t.GenericTypeArguments));
1413-
}
1414-
14151412
// If type can not get, must return null for fallback mechanism.
14161413
return null;
14171414
}

sandbox/Sandbox/Generated.cs

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#pragma warning disable 612
77
#pragma warning disable 414
88
#pragma warning disable 168
9+
#pragma warning disable CS1591 // document public APIs
910

1011
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
1112
#pragma warning disable SA1649 // File name should match first type name
@@ -228,6 +229,7 @@ internal static object GetFormatter(global::System.Type t)
228229
#pragma warning disable 612
229230
#pragma warning disable 414
230231
#pragma warning disable 168
232+
#pragma warning disable CS1591 // document public APIs
231233

232234
#pragma warning disable SA1403 // File may only contain a single namespace
233235
#pragma warning disable SA1649 // File name should match first type name
@@ -265,6 +267,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
265267
#pragma warning disable 612
266268
#pragma warning disable 414
267269
#pragma warning disable 168
270+
#pragma warning disable CS1591 // document public APIs
268271

269272
#pragma warning disable SA1403 // File may only contain a single namespace
270273
#pragma warning disable SA1649 // File name should match first type name
@@ -303,6 +306,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
303306
#pragma warning disable 612
304307
#pragma warning disable 414
305308
#pragma warning disable 168
309+
#pragma warning disable CS1591 // document public APIs
306310

307311
#pragma warning disable SA1403 // File may only contain a single namespace
308312
#pragma warning disable SA1649 // File name should match first type name
@@ -419,6 +423,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
419423
#pragma warning disable 612
420424
#pragma warning disable 414
421425
#pragma warning disable 168
426+
#pragma warning disable CS1591 // document public APIs
422427

423428
#pragma warning disable SA1403 // File may only contain a single namespace
424429
#pragma warning disable SA1649 // File name should match first type name
@@ -884,6 +889,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
884889
#pragma warning disable 612
885890
#pragma warning disable 414
886891
#pragma warning disable 168
892+
#pragma warning disable CS1591 // document public APIs
887893

888894
#pragma warning disable SA1129 // Do not use default value type constructor
889895
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -958,6 +964,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
958964
#pragma warning disable 612
959965
#pragma warning disable 414
960966
#pragma warning disable 168
967+
#pragma warning disable CS1591 // document public APIs
961968

962969
#pragma warning disable SA1129 // Do not use default value type constructor
963970
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1345,6 +1352,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
13451352
#pragma warning disable 612
13461353
#pragma warning disable 414
13471354
#pragma warning disable 168
1355+
#pragma warning disable CS1591 // document public APIs
13481356

13491357
#pragma warning disable SA1129 // Do not use default value type constructor
13501358
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1587,6 +1595,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
15871595
#pragma warning disable 612
15881596
#pragma warning disable 414
15891597
#pragma warning disable 168
1598+
#pragma warning disable CS1591 // document public APIs
15901599

15911600
#pragma warning disable SA1129 // Do not use default value type constructor
15921601
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -1734,6 +1743,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
17341743
#pragma warning disable 612
17351744
#pragma warning disable 414
17361745
#pragma warning disable 168
1746+
#pragma warning disable CS1591 // document public APIs
17371747

17381748
#pragma warning disable SA1129 // Do not use default value type constructor
17391749
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -3819,6 +3829,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
38193829
#pragma warning disable 612
38203830
#pragma warning disable 414
38213831
#pragma warning disable 168
3832+
#pragma warning disable CS1591 // document public APIs
38223833

38233834
#pragma warning disable SA1129 // Do not use default value type constructor
38243835
#pragma warning disable SA1309 // Field names should not begin with underscore

sandbox/TestData2/Generated.cs

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#pragma warning disable 612
77
#pragma warning disable 414
88
#pragma warning disable 168
9+
#pragma warning disable CS1591 // document public APIs
910

1011
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
1112
#pragma warning disable SA1649 // File name should match first type name
@@ -112,6 +113,7 @@ internal static object GetFormatter(global::System.Type t)
112113
#pragma warning disable 612
113114
#pragma warning disable 414
114115
#pragma warning disable 168
116+
#pragma warning disable CS1591 // document public APIs
115117

116118
#pragma warning disable SA1403 // File may only contain a single namespace
117119
#pragma warning disable SA1649 // File name should match first type name
@@ -164,6 +166,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
164166
#pragma warning disable 612
165167
#pragma warning disable 414
166168
#pragma warning disable 168
169+
#pragma warning disable CS1591 // document public APIs
167170

168171
#pragma warning disable SA1129 // Do not use default value type constructor
169172
#pragma warning disable SA1309 // Field names should not begin with underscore

src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version: 16.0.0.0
4+
// Runtime Version: 17.0.0.0
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
1717
/// <summary>
1818
/// Class to produce the template output
1919
/// </summary>
20-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
20+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2121
public partial class EnumTemplate : EnumTemplateBase
2222
{
2323
/// <summary>
@@ -33,6 +33,7 @@ public virtual string TransformText()
3333
#pragma warning disable 612
3434
#pragma warning disable 414
3535
#pragma warning disable 168
36+
#pragma warning disable CS1591 // document public APIs
3637
3738
#pragma warning disable SA1403 // File may only contain a single namespace
3839
#pragma warning disable SA1649 // File name should match first type name
@@ -77,7 +78,7 @@ namespace ");
7778
/// <summary>
7879
/// Base class for this transformation
7980
/// </summary>
80-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
81+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
8182
public class EnumTemplateBase
8283
{
8384
#region Fields

src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma warning disable 612
1212
#pragma warning disable 414
1313
#pragma warning disable 168
14+
#pragma warning disable CS1591 // document public APIs
1415

1516
#pragma warning disable SA1403 // File may only contain a single namespace
1617
#pragma warning disable SA1649 // File name should match first type name

src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version: 16.0.0.0
4+
// Runtime Version: 17.0.0.0
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
1717
/// <summary>
1818
/// Class to produce the template output
1919
/// </summary>
20-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
20+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2121
public partial class FormatterTemplate : FormatterTemplateBase
2222
{
2323
/// <summary>
@@ -33,6 +33,7 @@ public virtual string TransformText()
3333
#pragma warning disable 612
3434
#pragma warning disable 414
3535
#pragma warning disable 168
36+
#pragma warning disable CS1591 // document public APIs
3637
3738
#pragma warning disable SA1129 // Do not use default value type constructor
3839
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -226,7 +227,7 @@ namespace ");
226227
/// <summary>
227228
/// Base class for this transformation
228229
/// </summary>
229-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
230+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
230231
public class FormatterTemplateBase
231232
{
232233
#region Fields

src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma warning disable 612
1212
#pragma warning disable 414
1313
#pragma warning disable 168
14+
#pragma warning disable CS1591 // document public APIs
1415

1516
#pragma warning disable SA1129 // Do not use default value type constructor
1617
#pragma warning disable SA1309 // Field names should not begin with underscore

src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version: 16.0.0.0
4+
// Runtime Version: 17.0.0.0
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
1717
/// <summary>
1818
/// Class to produce the template output
1919
/// </summary>
20-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
20+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2121
public partial class ResolverTemplate : ResolverTemplateBase
2222
{
2323
/// <summary>
@@ -33,6 +33,7 @@ public virtual string TransformText()
3333
#pragma warning disable 612
3434
#pragma warning disable 414
3535
#pragma warning disable 168
36+
#pragma warning disable CS1591 // document public APIs
3637
3738
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
3839
#pragma warning disable SA1649 // File name should match first type name
@@ -130,7 +131,7 @@ internal static object GetFormatter(global::System.Type t)
130131
/// <summary>
131132
/// Base class for this transformation
132133
/// </summary>
133-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
134+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
134135
public class ResolverTemplateBase
135136
{
136137
#region Fields

src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma warning disable 612
1212
#pragma warning disable 414
1313
#pragma warning disable 168
14+
#pragma warning disable CS1591 // document public APIs
1415

1516
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
1617
#pragma warning disable SA1649 // File name should match first type name

src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version: 16.0.0.0
4+
// Runtime Version: 17.0.0.0
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
1717
/// <summary>
1818
/// Class to produce the template output
1919
/// </summary>
20-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
20+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2121
public partial class StringKeyFormatterTemplate : StringKeyFormatterTemplateBase
2222
{
2323
/// <summary>
@@ -33,6 +33,7 @@ public virtual string TransformText()
3333
#pragma warning disable 612
3434
#pragma warning disable 414
3535
#pragma warning disable 168
36+
#pragma warning disable CS1591 // document public APIs
3637
3738
#pragma warning disable SA1129 // Do not use default value type constructor
3839
#pragma warning disable SA1309 // Field names should not begin with underscore
@@ -212,7 +213,7 @@ namespace ");
212213
/// <summary>
213214
/// Base class for this transformation
214215
/// </summary>
215-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
216+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
216217
public class StringKeyFormatterTemplateBase
217218
{
218219
#region Fields

src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#pragma warning disable 612
1313
#pragma warning disable 414
1414
#pragma warning disable 168
15+
#pragma warning disable CS1591 // document public APIs
1516

1617
#pragma warning disable SA1129 // Do not use default value type constructor
1718
#pragma warning disable SA1309 // Field names should not begin with underscore

src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version: 16.0.0.0
4+
// Runtime Version: 17.0.0.0
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator
1717
/// <summary>
1818
/// Class to produce the template output
1919
/// </summary>
20-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
20+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2121
public partial class UnionTemplate : UnionTemplateBase
2222
{
2323
/// <summary>
@@ -33,6 +33,7 @@ public virtual string TransformText()
3333
#pragma warning disable 612
3434
#pragma warning disable 414
3535
#pragma warning disable 168
36+
#pragma warning disable CS1591 // document public APIs
3637
3738
#pragma warning disable SA1403 // File may only contain a single namespace
3839
#pragma warning disable SA1649 // File name should match first type name
@@ -152,7 +153,7 @@ namespace ");
152153
/// <summary>
153154
/// Base class for this transformation
154155
/// </summary>
155-
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
156+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
156157
public class UnionTemplateBase
157158
{
158159
#region Fields

src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma warning disable 612
1212
#pragma warning disable 414
1313
#pragma warning disable 168
14+
#pragma warning disable CS1591 // document public APIs
1415

1516
#pragma warning disable SA1403 // File may only contain a single namespace
1617
#pragma warning disable SA1649 // File name should match first type name

src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)