91 references to Name
CSharpSyntaxGenerator (91)
AbstractFileWriter.cs (4)
33_nodeMap = tree.Types.OfType<Node>().ToDictionary(n => n.Name); 34_typeMap = tree.Types.ToDictionary(n => n.Name); 35_parentMap = tree.Types.ToDictionary(n => n.Name, n => n.Base); 37_childMap = tree.Types.ToLookup(n => n.Base, n => n.Name);
SignatureWriter.cs (3)
24_typeMap = tree.Types.ToDictionary(n => n.Name, n => n.Base); 65_writer.WriteLine(" public abstract partial class {0} : {1}", node.Name, node.Base); 80_writer.WriteLine(" public partial class {0} : {1}", node.Name, node.Base);
SourceWriter.cs (79)
91WriteLine($"internal abstract partial class {node.Name} : {node.Base}"); 95WriteLine($"internal {node.Name}(SyntaxKind kind, DiagnosticInfo[]? diagnostics, SyntaxAnnotation[]? annotations)"); 98if (node.Name == "DirectiveTriviaSyntax") 105WriteLine($"internal {node.Name}(SyntaxKind kind)"); 108if (node.Name == "DirectiveTriviaSyntax") 150WriteLine($"internal sealed partial class {node.Name} : {node.Base}"); 169Write($"internal {node.Name}(SyntaxKind kind"); 181Write($"internal {node.Name}(SyntaxKind kind"); 194Write($"internal {node.Name}(SyntaxKind kind"); 268WriteLine($"internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.{node.Name}(this, parent, position);"); 294if (node.Name == "AttributeSyntax") 329Write($" => new {node.Name}("); 342Write($" => new {node.Name}("); 354WriteLine($"public override void Accept(CSharpSyntaxVisitor visitor) => visitor.Visit{StripPost(node.Name, "Syntax")}(this);"); 355WriteLine($"public override TResult Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor) => visitor.Visit{StripPost(node.Name, "Syntax")}(this);"); 373WriteLine($"public virtual {(withResult ? "TResult" : "void")} Visit{StripPost(node.Name, "Syntax")}({node.Name} node) => this.DefaultVisit(node);"); 381Write($"public {node.Name} Update("); 412Write($"var newNode = SyntaxFactory.{StripPost(node.Name, "Syntax")}("); 447WriteLine($"public override CSharpSyntaxNode Visit{StripPost(node.Name, "Syntax")}({node.Name} node)"); 516Write($"public {(withSyntaxFactoryContext ? "" : "static ")}{nd.Name} {StripPost(nd.Name, "Syntax")}("); 586if (nd.Name != "SkippedTokensTriviaSyntax" && 587nd.Name != "DocumentationCommentTriviaSyntax" && 588nd.Name != "IncompleteMemberSyntax" && 589nd.Name != "AttributeSyntax" && 620WriteLine($"if (cached != null) return ({nd.Name})cached;"); 624Write($"var result = new {nd.Name}("); 643Write($"return new {nd.Name}("); 705WriteLine($"public abstract partial class {node.Name} : {node.Base}"); 707WriteLine($"internal {node.Name}(InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)"); 724WriteLine($"public {node.Name} With{field.Name}({fieldType} {CamelCase(field.Name)}) => With{field.Name}Core({CamelCase(field.Name)});"); 725WriteLine($"internal abstract {node.Name} With{field.Name}Core({fieldType} {CamelCase(field.Name)});"); 731WriteLine($"public {node.Name} Add{field.Name}(params {argType}[] items) => Add{field.Name}Core(items);"); 732WriteLine($"internal abstract {node.Name} Add{field.Name}Core(params {argType}[] items);"); 746WriteLine($"public {node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items) => Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(items);"); 747WriteLine($"internal abstract {node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(params {argType}[] items);"); 773WriteLine($"public new {node.Name} With{baseField.Name}({GetRedFieldType(baseField)} {CamelCase(baseField.Name)}) => ({node.Name})With{baseField.Name}Core({CamelCase(baseField.Name)});"); 782WriteLine($"public new {node.Name} Add{baseField.Name}(params {argType}[] items) => ({node.Name})Add{baseField.Name}Core(items);"); 797WriteLine($"public new {baseType.Name} Add{StripPost(baseField.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items) => Add{StripPost(baseField.Name, "Opt")}{referencedNodeField.Name}Core(items);"); 821WriteLine($"public sealed partial class {node.Name} : {node.Base}"); 846WriteLine($"internal {node.Name}(InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)"); 866WriteLine($"var slot = ((Syntax.InternalSyntax.{node.Name})this.Green).{CamelCase(field.Name)};"); 873WriteLine($" => new SyntaxToken(this, ((InternalSyntax.{node.Name})this.Green).{CamelCase(field.Name)}, {GetChildPosition(i)}, {GetChildIndex(i)});"); 932WriteLine($"{"public"} {OverrideOrNewModifier(field)}{field.Type} {field.Name} => ((InternalSyntax.{node.Name})this.Green).{field.Name};"); 1049WriteLine($"public override {(genericResult ? "TResult?" : "void")} Accept{genericArgs}(CSharpSyntaxVisitor{genericArgs} visitor){(genericResult ? " where TResult : default" : "")} => visitor.Visit{StripPost(node.Name, "Syntax")}(this);"); 1072WriteComment($"<summary>Called when the visitor visits a {node.Name} node.</summary>"); 1073WriteLine($"public virtual {(genericResult ? "TResult?" : "void")} Visit{StripPost(node.Name, "Syntax")}({node.Name} node) => this.DefaultVisit(node);"); 1081Write($"public {node.Name} Update("); 1103Write($"var newNode = SyntaxFactory.{StripPost(node.Name, "Syntax")}("); 1135Write($"internal override {baseType.Name} With{field.Name}Core({GetRedPropertyType(baseField)} {CamelCase(field.Name)}) => With{field.Name}({CamelCase(field.Name)}"); 1147$"public{(isNew ? " new " : " ")}{node.Name} With{StripPost(field.Name, "Opt")}({type} {CamelCase(field.Name)})" + 1242WriteLine($"internal override {baseType.Name} Add{field.Name}Core(params {baseArgType}[] items) => Add{field.Name}(items);"); 1247WriteLine($"public{(isNew ? " new " : " ")}{node.Name} Add{field.Name}(params {argType}[] items) => With{StripPost(field.Name, "Opt")}(this.{field.Name}.AddRange(items));"); 1260WriteLine($"internal override {baseType.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}Core(params {argType}[] items) => Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(items);"); 1266Write($"public{(isNew ? " new " : " ")}{node.Name} Add{StripPost(field.Name, "Opt")}{referencedNodeField.Name}(params {argType}[] items)"); 1272var factoryName = StripPost(referencedNode.Name, "Syntax"); 1298WriteLine($"public override SyntaxNode? Visit{StripPost(node.Name, "Syntax")}({node.Name} node)"); 1422WriteComment($"<summary>Creates a new {nd.Name} instance.</summary>"); 1424Write($"public static {nd.Name} {StripPost(nd.Name, "Syntax")}("); 1483Write($"return ({nd.Name})Syntax.InternalSyntax.SyntaxFactory.{StripPost(nd.Name, "Syntax")}("); 1550return $"SyntaxFactory.Token(Get{StripPost(nd.Name, "Syntax")}{StripPost(field.Name, "Opt")}Kind(kind))"; 1556return $"SyntaxFactory.{StripPost(referencedNode.Name, "Syntax")}()"; 1568WriteLine($"private static SyntaxKind Get{StripPost(nd.Name, "Syntax")}{StripPost(field.Name, "Opt")}Kind(SyntaxKind kind)"); 1608WriteComment($"<summary>Creates a new {nd.Name} instance.</summary>"); 1609Write($"public static {nd.Name} {StripPost(nd.Name, "Syntax")}("); 1616Write($" => SyntaxFactory.{StripPost(nd.Name, "Syntax")}("); 1697WriteComment($"<summary>Creates a new {nd.Name} instance.</summary>"); 1698Write($"public static {nd.Name} {StripPost(nd.Name, "Syntax")}("); 1722Write($" => SyntaxFactory.{StripPost(nd.Name, "Syntax")}(");
TestWriter.cs (5)
104var strippedName = StripPost(node.Name, "Syntax"); 106WriteLine($"private static {csharpNamespace}{node.Name} Generate{strippedName}()"); 232var strippedName = StripPost(node.Name, "Syntax"); 342var strippedName = StripPost(node.Name, "Syntax"); 370var strippedName = StripPost(node.Name, "Syntax");