Skip to content

Commit d4214c0

Browse files
committed
Rename fields to explain intent better
1 parent 8b7633b commit d4214c0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/DynamoDBGenerator.SourceGenerator/Types/CodeFactory.cs

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ namespace DynamoDBGenerator.SourceGenerator.Types;
44

55
public readonly struct CodeFactory
66
{
7-
public CodeFactory(IEnumerable<string> code, IEnumerable<ITypeSymbol> typeIdentifiers)
7+
public CodeFactory(IEnumerable<string> lines, IEnumerable<ITypeSymbol> dependantTypes)
88
{
9-
_code = code;
10-
TypeIdentifiers = typeIdentifiers;
9+
_lines = lines;
10+
DependantTypes = dependantTypes;
1111
}
1212

13-
public CodeFactory(IEnumerable<string> code)
13+
public CodeFactory(IEnumerable<string> lines)
1414
{
15-
_code = code;
16-
TypeIdentifiers = Enumerable.Empty<ITypeSymbol>();
15+
_lines = lines;
16+
DependantTypes = Enumerable.Empty<ITypeSymbol>();
1717
}
1818

1919
/// <summary>
20-
/// The code surrounding all assignments.
20+
/// The code lines.
2121
/// </summary>
22-
private readonly IEnumerable<string> _code;
22+
private readonly IEnumerable<string> _lines;
2323

2424
/// <summary>
25-
/// The assignments that occur within the method.
25+
/// The types that are <see cref="_lines"/> are dependant on.
2626
/// </summary>
27-
private IEnumerable<ITypeSymbol> TypeIdentifiers { get; }
27+
private IEnumerable<ITypeSymbol> DependantTypes { get; }
2828

2929
public static IEnumerable<string> Create(
3030
ITypeSymbol typeSymbol,
@@ -38,11 +38,11 @@ ISet<ITypeSymbol> handledTypes
3838

3939
var code = codeSelector(typeSymbol);
4040

41-
foreach (var s in code._code)
41+
foreach (var s in code._lines)
4242
yield return s;
4343

44-
foreach (var x in code.TypeIdentifiers)
45-
foreach (var assignment in Create(x, codeSelector, handledTypes))
46-
yield return assignment;
44+
foreach (var nestedTypeSymbol in code.DependantTypes)
45+
foreach (var nestedCode in Create(nestedTypeSymbol, codeSelector, handledTypes))
46+
yield return nestedCode;
4747
}
4848
}

0 commit comments

Comments
 (0)