2 overrides of GetName
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1900
public override string
GetName
(SyntaxNode declaration)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
1953
Public Overrides Function
GetName
(declaration As SyntaxNode) As String
107 references to GetName
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
79
return CSharpSyntaxGenerator.Instance.
GetName
(namespaceDecl);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (55)
CodeGeneration\SyntaxGeneratorTests.cs (55)
2607
var actualNames = actualNodes.Select(n => Generator.
GetName
(n)).ToArray();
2647
var newDecl = Generator.RemoveNode(declaration, Generator.GetNamespaceImports(declaration).First(m => Generator.
GetName
(m) == name));
2855
var newDecl = Generator.RemoveNode(declaration, Generator.GetMembers(declaration).First(m => Generator.
GetName
(m) == name));
2897
Assert.Equal("c", Generator.
GetName
(Generator.ClassDeclaration("c")));
2898
Assert.Equal("s", Generator.
GetName
(Generator.StructDeclaration("s")));
2899
Assert.Equal("i", Generator.
GetName
(Generator.EnumDeclaration("i")));
2900
Assert.Equal("e", Generator.
GetName
(Generator.EnumDeclaration("e")));
2901
Assert.Equal("d", Generator.
GetName
(Generator.DelegateDeclaration("d")));
2902
Assert.Equal("m", Generator.
GetName
(Generator.MethodDeclaration("m")));
2903
Assert.Equal("", Generator.
GetName
(Generator.ConstructorDeclaration()));
2904
Assert.Equal("p", Generator.
GetName
(Generator.ParameterDeclaration("p")));
2905
Assert.Equal("p", Generator.
GetName
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))));
2907
Assert.Equal("f", Generator.
GetName
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))));
2908
Assert.Equal("v", Generator.
GetName
(Generator.EnumMember("v")));
2909
Assert.Equal("ef", Generator.
GetName
(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))));
2910
Assert.Equal("ep", Generator.
GetName
(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))));
2911
Assert.Equal("n", Generator.
GetName
(Generator.NamespaceDeclaration("n")));
2912
Assert.Equal("u", Generator.
GetName
(Generator.NamespaceImportDeclaration("u")));
2913
Assert.Equal("loc", Generator.
GetName
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
2914
Assert.Equal("a", Generator.
GetName
(Generator.Attribute("a")));
2920
Assert.Equal("c", Generator.
GetName
(Generator.WithName(Generator.ClassDeclaration("x"), "c")));
2921
Assert.Equal("s", Generator.
GetName
(Generator.WithName(Generator.StructDeclaration("x"), "s")));
2922
Assert.Equal("i", Generator.
GetName
(Generator.WithName(Generator.EnumDeclaration("x"), "i")));
2923
Assert.Equal("e", Generator.
GetName
(Generator.WithName(Generator.EnumDeclaration("x"), "e")));
2924
Assert.Equal("d", Generator.
GetName
(Generator.WithName(Generator.DelegateDeclaration("x"), "d")));
2925
Assert.Equal("m", Generator.
GetName
(Generator.WithName(Generator.MethodDeclaration("x"), "m")));
2926
Assert.Equal("", Generator.
GetName
(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor")));
2927
Assert.Equal("p", Generator.
GetName
(Generator.WithName(Generator.ParameterDeclaration("x"), "p")));
2928
Assert.Equal("p", Generator.
GetName
(Generator.WithName(Generator.PropertyDeclaration("x", Generator.IdentifierName("t")), "p")));
2930
Assert.Equal("f", Generator.
GetName
(Generator.WithName(Generator.FieldDeclaration("x", Generator.IdentifierName("t")), "f")));
2931
Assert.Equal("v", Generator.
GetName
(Generator.WithName(Generator.EnumMember("x"), "v")));
2932
Assert.Equal("ef", Generator.
GetName
(Generator.WithName(Generator.EventDeclaration("x", Generator.IdentifierName("t")), "ef")));
2933
Assert.Equal("ep", Generator.
GetName
(Generator.WithName(Generator.CustomEventDeclaration("x", Generator.IdentifierName("t")), "ep")));
2934
Assert.Equal("n", Generator.
GetName
(Generator.WithName(Generator.NamespaceDeclaration("x"), "n")));
2935
Assert.Equal("u", Generator.
GetName
(Generator.WithName(Generator.NamespaceImportDeclaration("x"), "u")));
2936
Assert.Equal("loc", Generator.
GetName
(Generator.WithName(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "x"), "loc")));
2937
Assert.Equal("a", Generator.
GetName
(Generator.WithName(Generator.Attribute("x"), "a")));
3798
Assert.Equal("X", Generator.
GetName
(declX));
3804
Assert.Equal("Y", Generator.
GetName
(declY));
3810
Assert.Equal("Z", Generator.
GetName
(declZ));
3822
Assert.Equal("Q", Generator.
GetName
(xNamedQ).ToString());
4138
Assert.Equal("X", Generator.
GetName
(attrX));
4139
Assert.Equal("Y", Generator.
GetName
(attrY));
4140
Assert.Equal("Z", Generator.
GetName
(attrZ));
4318
Assert.Equal("X", Generator.
GetName
(attrX));
4319
Assert.Equal("Y", Generator.
GetName
(attrY));
4320
Assert.Equal("Z", Generator.
GetName
(attrZ));
4406
Assert.Equal("X", Generator.
GetName
(attrX));
4410
Assert.Equal("Y", Generator.
GetName
(attrY));
4414
Assert.Equal("Z", Generator.
GetName
(attrZ));
4418
Assert.Equal("P", Generator.
GetName
(attrP));
4425
Assert.Equal("A", Generator.
GetName
(attrA));
4429
Assert.Equal("B", Generator.
GetName
(attrB));
4433
Assert.Equal("C", Generator.
GetName
(attrC));
4437
Assert.Equal("D", Generator.
GetName
(attrD));
Microsoft.CodeAnalysis.Features (1)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
119
declaredNamespace = syntaxGenerator.
GetName
(applicableNode);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (50)
CodeGeneration\SyntaxGeneratorTests.vb (50)
2591
Assert.Equal("c", Generator.
GetName
(Generator.ClassDeclaration("c")))
2592
Assert.Equal("s", Generator.
GetName
(Generator.StructDeclaration("s")))
2593
Assert.Equal("i", Generator.
GetName
(Generator.EnumDeclaration("i")))
2594
Assert.Equal("e", Generator.
GetName
(Generator.EnumDeclaration("e")))
2595
Assert.Equal("d", Generator.
GetName
(Generator.DelegateDeclaration("d")))
2596
Assert.Equal("m", Generator.
GetName
(Generator.MethodDeclaration("m")))
2597
Assert.Equal("m", Generator.
GetName
(Generator.MethodDeclaration("m", modifiers:=DeclarationModifiers.Abstract)))
2598
Assert.Equal("", Generator.
GetName
(Generator.ConstructorDeclaration()))
2599
Assert.Equal("p", Generator.
GetName
(Generator.ParameterDeclaration("p")))
2600
Assert.Equal("p", Generator.
GetName
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract)))
2601
Assert.Equal("p", Generator.
GetName
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))))
2602
Assert.Equal("Item", Generator.
GetName
(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"))))
2603
Assert.Equal("Item", Generator.
GetName
(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract)))
2604
Assert.Equal("f", Generator.
GetName
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))))
2605
Assert.Equal("v", Generator.
GetName
(Generator.EnumMember("v")))
2606
Assert.Equal("ef", Generator.
GetName
(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))))
2607
Assert.Equal("ep", Generator.
GetName
(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"))))
2608
Assert.Equal("n", Generator.
GetName
(Generator.NamespaceDeclaration("n")))
2609
Assert.Equal("u", Generator.
GetName
(Generator.NamespaceImportDeclaration("u")))
2610
Assert.Equal("loc", Generator.
GetName
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")))
2611
Assert.Equal("a", Generator.
GetName
(Generator.Attribute("a")))
2616
Assert.Equal("c", Generator.
GetName
(Generator.WithName(Generator.ClassDeclaration("x"), "c")))
2617
Assert.Equal("s", Generator.
GetName
(Generator.WithName(Generator.StructDeclaration("x"), "s")))
2618
Assert.Equal("i", Generator.
GetName
(Generator.WithName(Generator.EnumDeclaration("x"), "i")))
2619
Assert.Equal("e", Generator.
GetName
(Generator.WithName(Generator.EnumDeclaration("x"), "e")))
2620
Assert.Equal("d", Generator.
GetName
(Generator.WithName(Generator.DelegateDeclaration("x"), "d")))
2621
Assert.Equal("m", Generator.
GetName
(Generator.WithName(Generator.MethodDeclaration("x"), "m")))
2622
Assert.Equal("m", Generator.
GetName
(Generator.WithName(Generator.MethodDeclaration("x", modifiers:=DeclarationModifiers.Abstract), "m")))
2623
Assert.Equal("", Generator.
GetName
(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor")))
2624
Assert.Equal("p", Generator.
GetName
(Generator.WithName(Generator.ParameterDeclaration("x"), "p")))
2625
Assert.Equal("p", Generator.
GetName
(Generator.WithName(Generator.PropertyDeclaration("x", Generator.IdentifierName("t")), "p")))
2626
Assert.Equal("p", Generator.
GetName
(Generator.WithName(Generator.PropertyDeclaration("x", Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract), "p")))
2627
Assert.Equal("X", Generator.
GetName
(Generator.WithName(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t")), "X")))
2628
Assert.Equal("X", Generator.
GetName
(Generator.WithName(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract), "X")))
2629
Assert.Equal("f", Generator.
GetName
(Generator.WithName(Generator.FieldDeclaration("x", Generator.IdentifierName("t")), "f")))
2630
Assert.Equal("v", Generator.
GetName
(Generator.WithName(Generator.EnumMember("x"), "v")))
2631
Assert.Equal("ef", Generator.
GetName
(Generator.WithName(Generator.EventDeclaration("x", Generator.IdentifierName("t")), "ef")))
2632
Assert.Equal("ep", Generator.
GetName
(Generator.WithName(Generator.CustomEventDeclaration("x", Generator.IdentifierName("t")), "ep")))
2633
Assert.Equal("n", Generator.
GetName
(Generator.WithName(Generator.NamespaceDeclaration("x"), "n")))
2634
Assert.Equal("u", Generator.
GetName
(Generator.WithName(Generator.NamespaceImportDeclaration("x"), "u")))
2635
Assert.Equal("loc", Generator.
GetName
(Generator.WithName(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "x"), "loc")))
2636
Assert.Equal("a", Generator.
GetName
(Generator.WithName(Generator.Attribute("x"), "a")))
3141
Dim actualNames = actualNodes.Select(Function(n) Generator.
GetName
(n)).ToArray()
3489
Assert.Equal("X", Generator.
GetName
(declX))
3495
Assert.Equal("Y", Generator.
GetName
(declY))
3501
Assert.Equal("Z", Generator.
GetName
(declZ))
3513
Assert.Equal("Q", Generator.
GetName
(xNamedQ).ToString())
3738
Assert.Equal("X", Generator.
GetName
(declX))
3739
Assert.Equal("Y", Generator.
GetName
(declY))
3740
Assert.Equal("Z", Generator.
GetName
(declZ))