179 references to Name
CSharpSyntaxGenerator (179)
AbstractFileWriter.cs (2)
385
}).Single(f => f.
Name
== field.
Name
);
SignatureWriter.cs (3)
72
_writer.WriteLine(" public abstract {0}{1} {2} {{ get; }}", "", field.Type, field.
Name
);
91
_writer.WriteLine(" public {0}{1}{2} {3} {{ get; }}", "", "", field.Type, field.
Name
);
97
_writer.WriteLine(" public {0}{1}{2} {3} {{ get; }}", "", "", field.Type, field.
Name
);
SourceWriter.cs (160)
127
WriteLine($"public abstract {(IsNew(field) ? "new " : "")}CoreSyntax.{field.Type} {field.
Name
} {{ get; }}");
131
WriteLine($"public abstract {(IsNew(field) ? "new " : "")}{(GetFieldType(field, green: true))} {field.
Name
} {{ get; }}");
141
WriteLine($"public abstract {(IsNew(field) ? "new " : "")}{field.Type} {field.
Name
} {{ get; }}");
159
WriteLine($"internal readonly {type} {CamelCase(field.
Name
)};");
164
WriteLine($"internal readonly {field.Type} {CamelCase(field.
Name
)};");
212
WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.
Name
} => new {type}(this.{CamelCase(field.
Name
)});");
217
WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.
Name
} => new {type}(new CoreSyntax.SyntaxList<CSharpSyntaxNode>(this.{CamelCase(field.
Name
)}));");
222
WriteLine($"public {OverrideOrNewModifier(field)}{type} {field.
Name
} => new {type}(this.{CamelCase(field.
Name
)});");
226
WriteLine($"public {OverrideOrNewModifier(field)}{(GetFieldType(field, green: true))} {field.
Name
} => this.{CamelCase(field.
Name
)};");
233
WriteLine($"public {OverrideOrNewModifier(field)}{field.Type} {field.
Name
} => this.{CamelCase(field.
Name
)};");
248
WriteLine($"=> index == 0 ? this.{CamelCase(nodeFields[0].
Name
)} : null;");
260
WriteLine($"{i} => this.{CamelCase(field.
Name
)},");
283
Write($", {(GetFieldType(field, green: true))} {CamelCase(field.
Name
)}");
288
Write($", {field.Type} {CamelCase(field.
Name
)}");
306
WriteLine($"if ({CamelCase(field.
Name
)} != null)");
308
WriteLine($"this.AdjustFlagsAndWidth({CamelCase(field.
Name
)});");
309
WriteLine($"this.{CamelCase(field.
Name
)} = {CamelCase(field.
Name
)};");
314
WriteLine($"this.AdjustFlagsAndWidth({CamelCase(field.
Name
)});");
315
WriteLine($"this.{CamelCase(field.
Name
)} = {CamelCase(field.
Name
)};");
321
WriteLine($"this.{CamelCase(field.
Name
)} = {CamelCase(field.
Name
)};");
332
node.Fields.Select(f => $"this.{CamelCase(f.
Name
)}"),
345
node.Fields.Select(f => $"this.{CamelCase(f.
Name
)}"),
391
return $"{type} {CamelCase(f.
Name
)}";
404
Write($"{CamelCase(field.
Name
)} != this.{field.
Name
}");
415
node.Fields.Select(f => CamelCase(f.
Name
))));
460
return $"VisitList(node.{f.
Name
})";
462
return $"({f.Type})Visit(node.{f.
Name
})";
464
return $"node.{f.
Name
}";
539
var pname = CamelCase(field.
Name
);
543
WriteLine($"if ({CamelCase(field.
Name
)} == null) throw new ArgumentNullException(nameof({CamelCase(field.
Name
)}));");
549
WriteLine($"if ({CamelCase(field.
Name
)} != null)");
664
return $"{type} {CamelCase(f.
Name
)}";
674
? $"{CamelCase(f.
Name
)}.Node"
675
: CamelCase(f.
Name
)),
677
valueFields.Select(f => CamelCase(f.
Name
)),
723
WriteLine($"{"public"} abstract {(IsNew(field) ? "new " : "")}{fieldType} {field.
Name
} {{ get; }}");
724
WriteLine($"public {node.Name} With{field.
Name
}({fieldType} {CamelCase(field.
Name
)}) => With{field.
Name
}Core({CamelCase(field.
Name
)});");
725
WriteLine($"internal abstract {node.Name} With{field.
Name
}Core({fieldType} {CamelCase(field.
Name
)});");
731
WriteLine($"public {node.Name} Add{field.
Name
}(params {argType}[] items) => Add{field.
Name
}Core(items);");
732
WriteLine($"internal abstract {node.Name} Add{field.
Name
}Core(params {argType}[] items);");
746
WriteLine($"public {node.Name} Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}(params {argType}[] items) => Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}Core(items);");
747
WriteLine($"internal abstract {node.Name} Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}Core(params {argType}[] items);");
759
WriteLine($"{"public"} abstract {(IsNew(field) ? "new " : "")}{field.Type} {field.
Name
} {{ get; }}");
773
WriteLine($"public new {node.Name} With{baseField.
Name
}({GetRedFieldType(baseField)} {CamelCase(baseField.
Name
)}) => ({node.Name})With{baseField.
Name
}Core({CamelCase(baseField.
Name
)});");
782
WriteLine($"public new {node.Name} Add{baseField.
Name
}(params {argType}[] items) => ({node.Name})Add{baseField.
Name
}Core(items);");
797
WriteLine($"public new {baseType.Name} Add{StripPost(baseField.
Name
, "Opt")}{referencedNodeField.
Name
}(params {argType}[] items) => Add{StripPost(baseField.
Name
, "Opt")}{referencedNodeField.
Name
}Core(items);");
834
WriteLine($"private SyntaxNode? {CamelCase(field.
Name
)};");
839
WriteLine($"private {type} {CamelCase(field.
Name
)};");
859
Write($"public {OverrideOrNewModifier(field)}{GetRedPropertyType(field)} {field.
Name
}");
866
WriteLine($"var slot = ((Syntax.InternalSyntax.{node.Name})this.Green).{CamelCase(field.
Name
)};");
873
WriteLine($" => new SyntaxToken(this, ((InternalSyntax.{node.Name})this.Green).{CamelCase(field.
Name
)}, {GetChildPosition(i)}, {GetChildIndex(i)});");
879
WriteLine($"public {OverrideOrNewModifier(field)}SyntaxTokenList {field.
Name
}");
891
Write($"public {OverrideOrNewModifier(field)}{GetRedPropertyType(field)} {field.
Name
}");
895
WriteLine($" => new {field.Type}(GetRed(ref this.{CamelCase(field.
Name
)}, {i}));");
904
WriteLine($"var red = GetRed(ref this.{CamelCase(field.
Name
)}, {i});");
918
WriteLine($" => GetRedAtZero(ref this.{CamelCase(field.
Name
)}){suffix};");
922
WriteLine($" => GetRed(ref this.{CamelCase(field.
Name
)}, {i}){suffix};");
932
WriteLine($"{"public"} {OverrideOrNewModifier(field)}{field.Type} {field.
Name
} => ((InternalSyntax.{node.Name})this.Green).{field.
Name
};");
950
? $"GetRedAtZero(ref this.{CamelCase(field.
Name
)})"
951
: $"GetRed(ref this.{CamelCase(field.
Name
)}, {index})";
967
WriteLine($"{index} => GetRedAtZero(ref this.{CamelCase(field.
Name
)}){suffix},");
971
WriteLine($"{index} => GetRed(ref this.{CamelCase(field.
Name
)}, {index}){suffix},");
995
WriteLine($" => index == {index} ? this.{CamelCase(field.
Name
)} : null;");
1005
WriteLine($"{index} => this.{CamelCase(field.
Name
)},");
1083
node.Fields.Select(f => $"{GetRedPropertyType(f)} {CamelCase(f.
Name
)}")));
1095
Write($"{CamelCase(field.
Name
)} != this.{field.
Name
}");
1106
node.Fields.Select(f => CamelCase(f.
Name
))));
1132
var (baseType, baseField) = GetHighestBaseTypeWithField(node, field.
Name
);
1135
Write($"internal override {baseType.Name} With{field.
Name
}Core({GetRedPropertyType(baseField)} {CamelCase(field.
Name
)}) => With{field.
Name
}({CamelCase(field.
Name
)}");
1138
Write($" ?? throw new ArgumentNullException(nameof({CamelCase(field.
Name
)}))");
1147
$"public{(isNew ? " new " : " ")}{node.Name} With{StripPost(field.
Name
, "Opt")}({type} {CamelCase(field.
Name
)})" +
1152
f == field ? CamelCase(f.
Name
) : $"this.{f.
Name
}")));
1164
var field = fields.FirstOrDefault(f => f.
Name
== name);
1238
var (baseType, baseField) = GetHighestBaseTypeWithField(node, field.
Name
);
1242
WriteLine($"internal override {baseType.Name} Add{field.
Name
}Core(params {baseArgType}[] items) => Add{field.
Name
}(items);");
1247
WriteLine($"public{(isNew ? " new " : " ")}{node.Name} Add{field.
Name
}(params {argType}[] items) => With{StripPost(field.
Name
, "Opt")}(this.{field.
Name
}.AddRange(items));");
1257
var (baseType, _) = GetHighestBaseTypeWithField(node, field.
Name
);
1260
WriteLine($"internal override {baseType.Name} Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}Core(params {argType}[] items) => Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}(items);");
1266
Write($"public{(isNew ? " new " : " ")}{node.Name} Add{StripPost(field.
Name
, "Opt")}{referencedNodeField.
Name
}(params {argType}[] items)");
1273
var varName = StripPost(CamelCase(field.
Name
), "Opt");
1274
WriteLine($"var {varName} = this.{field.
Name
} ?? SyntaxFactory.{factoryName}();");
1275
WriteLine($"return With{StripPost(field.
Name
, "Opt")}({varName}.With{StripPost(referencedNodeField.
Name
, "Opt")}({varName}.{referencedNodeField.
Name
}.AddRange(items)));");
1280
WriteLine($" => With{StripPost(field.
Name
, "Opt")}(this.{field.
Name
}.With{StripPost(referencedNodeField.
Name
, "Opt")}(this.{field.
Name
}.{referencedNodeField.
Name
}.AddRange(items)));");
1312
return $"VisitList(node.{f.
Name
})";
1314
return $"VisitToken(node.{f.
Name
})";
1316
return $"({(GetFieldType(f, green: false))})Visit(node.{f.
Name
})";
1318
return $"({(GetFieldType(f, green: false))})Visit(node.{f.
Name
}) ?? throw new ArgumentNullException(\"{CamelCase(f.
Name
)}\")";
1321
return $"node.{f.
Name
}";
1447
var pname = CamelCase(field.
Name
);
1479
WriteLine($"if ({CamelCase(field.
Name
)} == null) throw new ArgumentNullException(nameof({CamelCase(field.
Name
)}));");
1491
return $"(Syntax.InternalSyntax.SyntaxToken?){CamelCase(f.
Name
)}.Node";
1494
return $"(Syntax.InternalSyntax.SyntaxToken){CamelCase(f.
Name
)}.Node!";
1497
return $"{CamelCase(f.
Name
)}.Node.ToGreenList<Syntax.InternalSyntax.SyntaxToken>()";
1499
return $"{CamelCase(f.
Name
)}.Node.ToGreenList<Syntax.InternalSyntax.{GetElementType(f.Type)}>()";
1501
return $"{CamelCase(f.
Name
)}.Node.ToGreenSeparatedList<Syntax.InternalSyntax.{GetElementType(f.Type)}>()";
1503
return $"{CamelCase(f.
Name
)}.Node.ToGreenList<Syntax.InternalSyntax.CSharpSyntaxNode>()";
1505
return $"{CamelCase(f.
Name
)} == null ? null : (Syntax.InternalSyntax.{f.Type}){CamelCase(f.
Name
)}.Green";
1507
return $"(Syntax.InternalSyntax.{f.Type}){CamelCase(f.
Name
)}.Green";
1510
valueFields.Select(f => CamelCase(f.
Name
))));
1520
nd.Fields.Select(f => $"{this.GetRedPropertyType(f)} {CamelCase(f.
Name
)}")));
1550
return $"SyntaxFactory.Token(Get{StripPost(nd.Name, "Syntax")}{StripPost(field.
Name
, "Opt")}Kind(kind))";
1568
WriteLine($"private static SyntaxKind Get{StripPost(nd.Name, "Syntax")}{StripPost(field.
Name
, "Opt")}Kind(SyntaxKind kind)");
1613
f => $"{GetRedPropertyType(f)} {CamelCase(f.
Name
)}")));
1620
? CamelCase(f.
Name
)
1651
return f.
Name
is "AttributeLists" or "Modifiers";
1710
return $"{type} {CamelCase(f.
Name
)}";
1717
return $"{type} {CamelCase(f.
Name
)} = default";
1733
return $"{GetStringConverterMethod(f)}({CamelCase(f.
Name
)})";
1735
return CamelCase(f.
Name
);
1740
return CamelCase(f.
Name
);
1742
return $"{CamelCase(f.
Name
)} ?? {GetDefaultValue(nd, f)}";
TestWriter.cs (14)
158
Write($"{syntaxFactory}.Identifier(\"{field.
Name
}\")");
179
Write($"{syntaxFactory}.IdentifierName({syntaxFactory}.Identifier(\"{field.
Name
}\"))");
251
WriteLine($"Assert.Equal(SyntaxKind.None, node.{field.
Name
}.Kind());");
255
WriteLine($"Assert.Null(node.{field.
Name
});");
263
WriteLine($"Assert.Equal(SyntaxKind.{kind}, node.{field.
Name
}.Kind());");
267
WriteLine($"Assert.Equal(SyntaxKind.{kind}, node.{field.
Name
}.Kind);");
274
WriteLine($"Assert.NotEqual(default, node.{field.
Name
});");
281
WriteLine($"Assert.Equal(default, node.{field.
Name
});");
285
WriteLine($"Assert.NotNull(node.{field.
Name
});");
291
withStat += $".With{field.
Name
}(node.{field.
Name
})";
297
WriteLine($"Assert.Equal(new {field.Type}(), node.{field.
Name
});");
300
withStat += $".With{field.
Name
}(node.{field.
Name
})";