Skip to content

Commit 8d61397

Browse files
committed
Rename methods
1 parent d4214c0 commit 8d61397

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/DynamoDBGenerator.SourceGenerator/Generations/AttributeExpressionName.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal static IEnumerable<string> CreateClasses(IEnumerable<DynamoDBMarshaller
1919
.SelectMany(x => CodeFactory.Create(x.EntityTypeSymbol, y => CreateStruct(y, getDynamoDbProperties, options), hashSet));
2020

2121
}
22-
private static IEnumerable<string> CreateCode(
22+
private static IEnumerable<string> TypeContent(
2323
ITypeSymbol typeSymbol,
2424
(bool IsUnknown, DynamoDbDataMember DDB, string NameRef, string AttributeReference, string AttributeInterfaceName)[] dataMembers,
2525
string structName)
@@ -80,7 +80,7 @@ private static CodeFactory CreateStruct(ITypeSymbol typeSymbol, Func<ITypeSymbol
8080

8181
var structName = TypeName(typeSymbol);
8282

83-
var @class = $"public readonly struct {structName} : {AttributeExpressionNameTrackerInterface}".CreateScope(CreateCode(typeSymbol, dataMembers, structName));
83+
var @class = $"public readonly struct {structName} : {AttributeExpressionNameTrackerInterface}".CreateScope(TypeContent(typeSymbol, dataMembers, structName));
8484
return new CodeFactory(@class, dataMembers.Where(x => x.IsUnknown).Select(x => x.DDB.DataMember.Type));
8585

8686
}

src/DynamoDBGenerator.SourceGenerator/Generations/AttributeExpressionValue.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class AttributeExpressionValue
99
private static readonly Func<ITypeSymbol, string> TypeName = TypeExtensions.SuffixedTypeSymbolNameFactory("Values", SymbolEqualityComparer.Default);
1010

1111
private const string ValueProvider = "valueIdProvider";
12-
private static IEnumerable<string> CreateCode(
12+
private static IEnumerable<string> TypeContents(
1313
ITypeSymbol typeSymbol,
1414
(bool IsUnknown, DynamoDbDataMember DDB, string ValueRef, string AttributeReference, string AttributeInterfaceName)[] dataMembers,
1515
string structName,
@@ -101,7 +101,7 @@ private static CodeFactory CreateStruct(ITypeSymbol typeSymbol, Func<ITypeSymbol
101101
var structName = TypeName(typeSymbol);
102102
var interfaceName = $"{Constants.DynamoDBGenerator.Marshaller.AttributeExpressionValueTrackerInterface}<{typeSymbol.Representation().annotated}>";
103103

104-
var @struct = $"public readonly struct {structName} : {interfaceName}".CreateScope(CreateCode(typeSymbol, dataMembers, structName, interfaceName, options));
104+
var @struct = $"public readonly struct {structName} : {interfaceName}".CreateScope(TypeContents(typeSymbol, dataMembers, structName, interfaceName, options));
105105

106106
return new CodeFactory(@struct, dataMembers.Where(x => x.IsUnknown).Select(x => x.DDB.DataMember.Type));
107107

src/DynamoDBGenerator.SourceGenerator/Generations/KeyMarshaller.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static IEnumerable<string> CreateAssignment(string validateReference, st
2626
return $"if({validateReference})".CreateScope(innerContent);
2727

2828
}
29-
private static IEnumerable<string> CreateBody(ITypeSymbol typeSymbol, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> fn, MarshallerOptions options)
29+
private static IEnumerable<string> MethodBody(ITypeSymbol typeSymbol, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> fn, MarshallerOptions options)
3030
{
3131
var keyStructure = DynamoDbDataMember.GetKeyStructure(fn(typeSymbol));
3232
if (keyStructure is null)
@@ -114,7 +114,7 @@ private static CodeFactory StaticAttributeValueDictionaryKeys(ITypeSymbol typeSy
114114
{
115115

116116
var code = $"private static Dictionary<string, AttributeValue> {MethodName(typeSymbol)}({MarshallerOptions.Name} {MarshallerOptions.ParamReference}, object? {PkReference}, object? {RkReference}, bool {EnforcePkReference}, bool {EnforceRkReference}, string? index = null)"
117-
.CreateScope(CreateBody(typeSymbol, fn, options));
117+
.CreateScope(MethodBody(typeSymbol, fn, options));
118118

119119
return new CodeFactory(code);
120120

src/DynamoDBGenerator.SourceGenerator/Generations/Marshaller.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class Marshaller
1414

1515
internal static IEnumerable<string> CreateClass(IEnumerable<DynamoDBMarshallerArguments> arguments, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> getDynamoDbProperties, MarshallerOptions options)
1616
{
17-
return $"private static class {ClassName}".CreateScope(CreateMarshaller(arguments, getDynamoDbProperties, options));
17+
return $"private static class {ClassName}".CreateScope(TypeContent(arguments, getDynamoDbProperties, options));
1818
}
1919
private static CodeFactory CreateDictionaryMethod(ITypeSymbol typeSymbol, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> fn, MarshallerOptions options)
2020
{
@@ -59,7 +59,7 @@ private static CodeFactory CreateDictionaryMethod(ITypeSymbol typeSymbol, Func<I
5959

6060
}
6161

62-
private static IEnumerable<string> CreateMarshaller(IEnumerable<DynamoDBMarshallerArguments> arguments, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> getDynamoDbProperties, MarshallerOptions options)
62+
private static IEnumerable<string> TypeContent(IEnumerable<DynamoDBMarshallerArguments> arguments, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> getDynamoDbProperties, MarshallerOptions options)
6363
{
6464
var hashset = new HashSet<ITypeSymbol>(SymbolEqualityComparer.IncludeNullability);
6565

src/DynamoDBGenerator.SourceGenerator/Generations/Unmarshaller.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static class Unmarshaller
4545
internal static IEnumerable<string> CreateClass(IEnumerable<DynamoDBMarshallerArguments> arguments,
4646
Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> getDynamoDbProperties, MarshallerOptions options)
4747
{
48-
return $"private static class {UnMarshallerClass}".CreateScope(CreateUnMarshaller(arguments, getDynamoDbProperties, options));
48+
return $"private static class {UnMarshallerClass}".CreateScope(CreateTypeContents(arguments, getDynamoDbProperties, options));
4949
}
5050
private static CodeFactory CreateCode(ITypeSymbol type, Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> fn, MarshallerOptions options)
5151
{
@@ -136,7 +136,7 @@ private static string CreateSignature(ITypeSymbol typeSymbol)
136136
{
137137
return $"public static {typeSymbol.Representation().annotated} {GetDeserializationMethodName(typeSymbol)}(AttributeValue? {Value}, {MarshallerOptions.Name} {MarshallerOptions.ParamReference}, string? {DataMember} = null)";
138138
}
139-
private static IEnumerable<string> CreateUnMarshaller(IEnumerable<DynamoDBMarshallerArguments> arguments,
139+
private static IEnumerable<string> CreateTypeContents(IEnumerable<DynamoDBMarshallerArguments> arguments,
140140
Func<ITypeSymbol, IReadOnlyList<DynamoDbDataMember>> getDynamoDbProperties, MarshallerOptions options)
141141
{
142142
var hashSet = new HashSet<ITypeSymbol>(SymbolEqualityComparer.IncludeNullability);

0 commit comments

Comments
 (0)