1 override of WithName
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2077public override SyntaxNode WithName(SyntaxNode declaration, string name)
24 references to WithName
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (22)
CodeGeneration\SyntaxGeneratorTests.cs (22)
3053Assert.Equal("c", Generator.GetName(Generator.WithName(Generator.ClassDeclaration("x"), "c"))); 3054Assert.Equal("s", Generator.GetName(Generator.WithName(Generator.StructDeclaration("x"), "s"))); 3055Assert.Equal("i", Generator.GetName(Generator.WithName(Generator.EnumDeclaration("x"), "i"))); 3056Assert.Equal("e", Generator.GetName(Generator.WithName(Generator.EnumDeclaration("x"), "e"))); 3057Assert.Equal("d", Generator.GetName(Generator.WithName(Generator.DelegateDeclaration("x"), "d"))); 3058Assert.Equal("m", Generator.GetName(Generator.WithName(Generator.MethodDeclaration("x"), "m"))); 3059Assert.Equal("", Generator.GetName(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor"))); 3060Assert.Equal("p", Generator.GetName(Generator.WithName(Generator.ParameterDeclaration("x"), "p"))); 3061Assert.Equal("p", Generator.GetName(Generator.WithName(Generator.PropertyDeclaration("x", Generator.IdentifierName("t")), "p"))); 3062Assert.Equal("", Generator.GetName(Generator.WithName(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), "this"))); 3063Assert.Equal("f", Generator.GetName(Generator.WithName(Generator.FieldDeclaration("x", Generator.IdentifierName("t")), "f"))); 3064Assert.Equal("v", Generator.GetName(Generator.WithName(Generator.EnumMember("x"), "v"))); 3065Assert.Equal("ef", Generator.GetName(Generator.WithName(Generator.EventDeclaration("x", Generator.IdentifierName("t")), "ef"))); 3066Assert.Equal("ep", Generator.GetName(Generator.WithName(Generator.CustomEventDeclaration("x", Generator.IdentifierName("t")), "ep"))); 3067Assert.Equal("n", Generator.GetName(Generator.WithName(Generator.NamespaceDeclaration("x"), "n"))); 3068Assert.Equal("u", Generator.GetName(Generator.WithName(Generator.NamespaceImportDeclaration("x"), "u"))); 3069Assert.Equal("loc", Generator.GetName(Generator.WithName(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "x"), "loc"))); 3070Assert.Equal("a", Generator.GetName(Generator.WithName(Generator.Attribute("x"), "a"))); 4018var xNamedQ = Generator.WithName(declX, "Q"); 4153Generator.ReplaceNode(declC, declX, Generator.WithName(declX, "Q")), 4396var xNamedQ = Generator.WithName(attrX, "Q"); 4610var xNamedQ = Generator.WithName(attrX, "Q");
Microsoft.CodeAnalysis.Workspaces (1)
Editing\SyntaxEditorExtensions.cs (1)
27=> editor.ReplaceNode(declaration, (d, g) => g.WithName(d, name));
Roslyn.Diagnostics.Analyzers (1)
AbstractRunIterations`1.cs (1)
138var newNode = syntaxGenerator.WithName(node, name);