2 overrides of GetDeclarationKind
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1897
public override DeclarationKind
GetDeclarationKind
(SyntaxNode declaration)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
1756
Public Overrides Function
GetDeclarationKind
(declaration As SyntaxNode) As DeclarationKind
69 references to GetDeclarationKind
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (31)
CodeGeneration\SyntaxGeneratorTests.cs (31)
2873
Assert.Equal(DeclarationKind.CompilationUnit, Generator.
GetDeclarationKind
(Generator.CompilationUnit()));
2874
Assert.Equal(DeclarationKind.Class, Generator.
GetDeclarationKind
(Generator.ClassDeclaration("c")));
2875
Assert.Equal(DeclarationKind.Struct, Generator.
GetDeclarationKind
(Generator.StructDeclaration("s")));
2876
Assert.Equal(DeclarationKind.Interface, Generator.
GetDeclarationKind
(Generator.InterfaceDeclaration("i")));
2877
Assert.Equal(DeclarationKind.Enum, Generator.
GetDeclarationKind
(Generator.EnumDeclaration("e")));
2878
Assert.Equal(DeclarationKind.Delegate, Generator.
GetDeclarationKind
(Generator.DelegateDeclaration("d")));
2879
Assert.Equal(DeclarationKind.Method, Generator.
GetDeclarationKind
(Generator.MethodDeclaration("m")));
2880
Assert.Equal(DeclarationKind.Constructor, Generator.
GetDeclarationKind
(Generator.ConstructorDeclaration()));
2881
Assert.Equal(DeclarationKind.Parameter, Generator.
GetDeclarationKind
(Generator.ParameterDeclaration("p")));
2882
Assert.Equal(DeclarationKind.Property, Generator.
GetDeclarationKind
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))));
2884
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))));
2885
Assert.Equal(DeclarationKind.EnumMember, Generator.
GetDeclarationKind
(Generator.EnumMember("v")));
2886
Assert.Equal(DeclarationKind.Event, Generator.
GetDeclarationKind
(Generator.EventDeclaration("ef", Generator.IdentifierName("t"))));
2887
Assert.Equal(DeclarationKind.CustomEvent, Generator.
GetDeclarationKind
(Generator.CustomEventDeclaration("e", Generator.IdentifierName("t"))));
2888
Assert.Equal(DeclarationKind.Namespace, Generator.
GetDeclarationKind
(Generator.NamespaceDeclaration("n")));
2889
Assert.Equal(DeclarationKind.NamespaceImport, Generator.
GetDeclarationKind
(Generator.NamespaceImportDeclaration("u")));
2890
Assert.Equal(DeclarationKind.Variable, Generator.
GetDeclarationKind
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")));
2891
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(Generator.Attribute("a")));
3792
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declX));
3793
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declY));
3794
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declZ));
3815
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xTypedT));
3820
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xNamedQ));
3825
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xInitialized));
3830
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xPrivate));
3835
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xReadOnly));
3840
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xAttributed));
4143
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xNamedQ));
4148
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xWithArg));
4323
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xNamedQ));
4328
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xWithArg));
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (34)
CodeGeneration\SyntaxGeneratorTests.vb (34)
2565
Assert.Equal(DeclarationKind.CompilationUnit, Generator.
GetDeclarationKind
(Generator.CompilationUnit()))
2566
Assert.Equal(DeclarationKind.Class, Generator.
GetDeclarationKind
(Generator.ClassDeclaration("c")))
2567
Assert.Equal(DeclarationKind.Struct, Generator.
GetDeclarationKind
(Generator.StructDeclaration("s")))
2568
Assert.Equal(DeclarationKind.Interface, Generator.
GetDeclarationKind
(Generator.InterfaceDeclaration("i")))
2569
Assert.Equal(DeclarationKind.Enum, Generator.
GetDeclarationKind
(Generator.EnumDeclaration("e")))
2570
Assert.Equal(DeclarationKind.Delegate, Generator.
GetDeclarationKind
(Generator.DelegateDeclaration("d")))
2571
Assert.Equal(DeclarationKind.Method, Generator.
GetDeclarationKind
(Generator.MethodDeclaration("m")))
2572
Assert.Equal(DeclarationKind.Method, Generator.
GetDeclarationKind
(Generator.MethodDeclaration("m", modifiers:=DeclarationModifiers.Abstract)))
2573
Assert.Equal(DeclarationKind.Constructor, Generator.
GetDeclarationKind
(Generator.ConstructorDeclaration()))
2574
Assert.Equal(DeclarationKind.Parameter, Generator.
GetDeclarationKind
(Generator.ParameterDeclaration("p")))
2575
Assert.Equal(DeclarationKind.Property, Generator.
GetDeclarationKind
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))))
2576
Assert.Equal(DeclarationKind.Property, Generator.
GetDeclarationKind
(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract)))
2577
Assert.Equal(DeclarationKind.Indexer, Generator.
GetDeclarationKind
(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"))))
2578
Assert.Equal(DeclarationKind.Indexer, Generator.
GetDeclarationKind
(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"), modifiers:=DeclarationModifiers.Abstract)))
2579
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(Generator.FieldDeclaration("f", Generator.IdentifierName("t"))))
2580
Assert.Equal(DeclarationKind.EnumMember, Generator.
GetDeclarationKind
(Generator.EnumMember("v")))
2581
Assert.Equal(DeclarationKind.Event, Generator.
GetDeclarationKind
(Generator.EventDeclaration("e", Generator.IdentifierName("t"))))
2582
Assert.Equal(DeclarationKind.CustomEvent, Generator.
GetDeclarationKind
(Generator.CustomEventDeclaration("ce", Generator.IdentifierName("t"))))
2583
Assert.Equal(DeclarationKind.Namespace, Generator.
GetDeclarationKind
(Generator.NamespaceDeclaration("n")))
2584
Assert.Equal(DeclarationKind.NamespaceImport, Generator.
GetDeclarationKind
(Generator.NamespaceImportDeclaration("u")))
2585
Assert.Equal(DeclarationKind.Variable, Generator.
GetDeclarationKind
(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc")))
2586
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(Generator.Attribute("a")))
3483
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declX))
3484
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declY))
3485
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(declZ))
3506
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xTypedT))
3511
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xNamedQ))
3516
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xInitialized))
3521
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xPrivate))
3526
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xReadOnly))
3531
Assert.Equal(DeclarationKind.Field, Generator.
GetDeclarationKind
(xAttributed))
3743
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xNamedQ))
3748
Assert.Equal(DeclarationKind.Attribute, Generator.
GetDeclarationKind
(xWithArg))
3869
Assert.Equal(DeclarationKind.NamespaceImport, Generator.
GetDeclarationKind
(xRenamedQ))
Microsoft.CodeAnalysis.Workspaces (3)
Editing\SyntaxGenerator.cs (3)
89
if (
GetDeclarationKind
(node) != DeclarationKind.None)
107
if (
GetDeclarationKind
(node) == kind)
1322
=> this.GetAccessors(declaration).FirstOrDefault(a =>
GetDeclarationKind
(a) == kind);
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
105
if (gen.
GetDeclarationKind
(member) != DeclarationKind.Method)