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