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)
91
WriteLine($"internal abstract partial class {node.
Name
} : {node.Base}");
95
WriteLine($"internal {node.
Name
}(SyntaxKind kind, DiagnosticInfo[]? diagnostics, SyntaxAnnotation[]? annotations)");
98
if (node.
Name
== "DirectiveTriviaSyntax")
105
WriteLine($"internal {node.
Name
}(SyntaxKind kind)");
108
if (node.
Name
== "DirectiveTriviaSyntax")
150
WriteLine($"internal sealed partial class {node.
Name
} : {node.Base}");
169
Write($"internal {node.
Name
}(SyntaxKind kind");
181
Write($"internal {node.
Name
}(SyntaxKind kind");
194
Write($"internal {node.
Name
}(SyntaxKind kind");
268
WriteLine($"internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.{node.
Name
}(this, parent, position);");
294
if (node.
Name
== "AttributeSyntax")
329
Write($" => new {node.
Name
}(");
342
Write($" => new {node.
Name
}(");
354
WriteLine($"public override void Accept(CSharpSyntaxVisitor visitor) => visitor.Visit{StripPost(node.
Name
, "Syntax")}(this);");
355
WriteLine($"public override TResult Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor) => visitor.Visit{StripPost(node.
Name
, "Syntax")}(this);");
373
WriteLine($"public virtual {(withResult ? "TResult" : "void")} Visit{StripPost(node.
Name
, "Syntax")}({node.
Name
} node) => this.DefaultVisit(node);");
381
Write($"public {node.
Name
} Update(");
412
Write($"var newNode = SyntaxFactory.{StripPost(node.
Name
, "Syntax")}(");
447
WriteLine($"public override CSharpSyntaxNode Visit{StripPost(node.
Name
, "Syntax")}({node.
Name
} node)");
516
Write($"public {(withSyntaxFactoryContext ? "" : "static ")}{nd.
Name
} {StripPost(nd.
Name
, "Syntax")}(");
586
if (nd.
Name
!= "SkippedTokensTriviaSyntax" &&
587
nd.
Name
!= "DocumentationCommentTriviaSyntax" &&
588
nd.
Name
!= "IncompleteMemberSyntax" &&
589
nd.
Name
!= "AttributeSyntax" &&
620
WriteLine($"if (cached != null) return ({nd.
Name
})cached;");
624
Write($"var result = new {nd.
Name
}(");
643
Write($"return new {nd.
Name
}(");
705
WriteLine($"public abstract partial class {node.
Name
} : {node.Base}");
707
WriteLine($"internal {node.
Name
}(InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)");
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);");
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);");
821
WriteLine($"public sealed partial class {node.
Name
} : {node.Base}");
846
WriteLine($"internal {node.
Name
}(InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)");
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)});");
932
WriteLine($"{"public"} {OverrideOrNewModifier(field)}{field.Type} {field.Name} => ((InternalSyntax.{node.
Name
})this.Green).{field.Name};");
1049
WriteLine($"public override {(genericResult ? "TResult?" : "void")} Accept{genericArgs}(CSharpSyntaxVisitor{genericArgs} visitor){(genericResult ? " where TResult : default" : "")} => visitor.Visit{StripPost(node.
Name
, "Syntax")}(this);");
1072
WriteComment($"<summary>Called when the visitor visits a {node.
Name
} node.</summary>");
1073
WriteLine($"public virtual {(genericResult ? "TResult?" : "void")} Visit{StripPost(node.
Name
, "Syntax")}({node.
Name
} node) => this.DefaultVisit(node);");
1081
Write($"public {node.
Name
} Update(");
1103
Write($"var newNode = SyntaxFactory.{StripPost(node.
Name
, "Syntax")}(");
1135
Write($"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)})" +
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));");
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)");
1272
var factoryName = StripPost(referencedNode.
Name
, "Syntax");
1298
WriteLine($"public override SyntaxNode? Visit{StripPost(node.
Name
, "Syntax")}({node.
Name
} node)");
1422
WriteComment($"<summary>Creates a new {nd.
Name
} instance.</summary>");
1424
Write($"public static {nd.
Name
} {StripPost(nd.
Name
, "Syntax")}(");
1483
Write($"return ({nd.
Name
})Syntax.InternalSyntax.SyntaxFactory.{StripPost(nd.
Name
, "Syntax")}(");
1550
return $"SyntaxFactory.Token(Get{StripPost(nd.
Name
, "Syntax")}{StripPost(field.Name, "Opt")}Kind(kind))";
1556
return $"SyntaxFactory.{StripPost(referencedNode.
Name
, "Syntax")}()";
1568
WriteLine($"private static SyntaxKind Get{StripPost(nd.
Name
, "Syntax")}{StripPost(field.Name, "Opt")}Kind(SyntaxKind kind)");
1608
WriteComment($"<summary>Creates a new {nd.
Name
} instance.</summary>");
1609
Write($"public static {nd.
Name
} {StripPost(nd.
Name
, "Syntax")}(");
1616
Write($" => SyntaxFactory.{StripPost(nd.
Name
, "Syntax")}(");
1697
WriteComment($"<summary>Creates a new {nd.
Name
} instance.</summary>");
1698
Write($"public static {nd.
Name
} {StripPost(nd.
Name
, "Syntax")}(");
1722
Write($" => SyntaxFactory.{StripPost(nd.
Name
, "Syntax")}(");
TestWriter.cs (5)
104
var strippedName = StripPost(node.
Name
, "Syntax");
106
WriteLine($"private static {csharpNamespace}{node.
Name
} Generate{strippedName}()");
232
var strippedName = StripPost(node.
Name
, "Syntax");
342
var strippedName = StripPost(node.
Name
, "Syntax");
370
var strippedName = StripPost(node.
Name
, "Syntax");