111 references to DeclarationKind
Microsoft.CodeAnalysis.CSharp (111)
Compilation\CSharpCompilation.cs (3)
4876
if (current.Kind ==
DeclarationKind
.Namespace)
4916
if (_includeMember || _includeType || child.Kind ==
DeclarationKind
.Namespace)
4984
if (declaration.Kind ==
DeclarationKind
.Namespace)
Declarations\Declaration.cs (1)
67
public abstract
DeclarationKind
Kind { get; }
Declarations\DeclarationKind.cs (9)
31
internal static
DeclarationKind
ToDeclarationKind(this SyntaxKind kind)
35
case SyntaxKind.ClassDeclaration: return
DeclarationKind
.Class;
36
case SyntaxKind.InterfaceDeclaration: return
DeclarationKind
.Interface;
37
case SyntaxKind.StructDeclaration: return
DeclarationKind
.Struct;
40
return
DeclarationKind
.Namespace;
41
case SyntaxKind.EnumDeclaration: return
DeclarationKind
.Enum;
42
case SyntaxKind.DelegateDeclaration: return
DeclarationKind
.Delegate;
43
case SyntaxKind.RecordDeclaration: return
DeclarationKind
.Record;
44
case SyntaxKind.RecordStructDeclaration: return
DeclarationKind
.RecordStruct;
Declarations\DeclarationTable.cs (4)
200
private static readonly Predicate<Declaration> s_isNamespacePredicate = d => d.Kind ==
DeclarationKind
.Namespace;
201
private static readonly Predicate<Declaration> s_isTypePredicate = d => d.Kind !=
DeclarationKind
.Namespace;
334
if (current.Kind ==
DeclarationKind
.Namespace)
365
if (includeMember || includeType || childNamespaceOrType.Kind ==
DeclarationKind
.Namespace)
Declarations\DeclarationTreeBuilder.cs (29)
104
DeclarationKind
.Namespace => throw ExceptionUtilities.Unreachable(),
107
DeclarationKind
.Delegate => false,
109
DeclarationKind
.Class or
110
DeclarationKind
.Interface or
111
DeclarationKind
.Struct or
112
DeclarationKind
.Enum or
113
DeclarationKind
.Script or
114
DeclarationKind
.Submission or
115
DeclarationKind
.ImplicitClass or
116
DeclarationKind
.Record or
117
DeclarationKind
.RecordStruct => true,
219
kind:
DeclarationKind
.ImplicitClass,
244
kind:
DeclarationKind
.Class,
279
if (decl.Kind ==
DeclarationKind
.Namespace)
334
kind: _isSubmission ?
DeclarationKind
.Submission :
DeclarationKind
.Script,
658
return VisitTypeDeclaration(node,
DeclarationKind
.Class);
663
return VisitTypeDeclaration(node,
DeclarationKind
.Struct);
668
return VisitTypeDeclaration(node,
DeclarationKind
.Interface);
675
SyntaxKind.RecordDeclaration =>
DeclarationKind
.Record,
676
SyntaxKind.RecordStructDeclaration =>
DeclarationKind
.RecordStruct,
683
private SingleTypeDeclaration VisitTypeDeclaration(TypeDeclarationSyntax node,
DeclarationKind
kind)
755
if (modifier.IsKind(SyntaxKind.StaticKeyword) && kind ==
DeclarationKind
.Class)
759
else if (modifier.IsKind(SyntaxKind.ReadOnlyKeyword) && kind is
DeclarationKind
.Struct or
DeclarationKind
.RecordStruct)
763
else if (modifier.IsKind(SyntaxKind.RefKeyword) && kind is
DeclarationKind
.Struct or
DeclarationKind
.RecordStruct)
818
kind:
DeclarationKind
.Delegate,
856
kind:
DeclarationKind
.Enum,
Declarations\MergedNamespaceDeclaration.cs (2)
38
public override
DeclarationKind
Kind
42
return
DeclarationKind
.Namespace;
Declarations\MergedTypeDeclaration.cs (1)
102
public override
DeclarationKind
Kind
Declarations\SingleNamespaceDeclaration.cs (2)
26
public override
DeclarationKind
Kind
30
return
DeclarationKind
.Namespace;
Declarations\SingleTypeDeclaration.cs (6)
19
private readonly
DeclarationKind
_kind;
73
DeclarationKind
kind,
86
Debug.Assert(kind !=
DeclarationKind
.Namespace);
97
public override
DeclarationKind
Kind
263
if (thisDecl._kind ==
DeclarationKind
.Enum || thisDecl._kind ==
DeclarationKind
.Delegate)
Symbols\EnumConversions.cs (11)
13
internal static TypeKind ToTypeKind(this
DeclarationKind
kind)
17
case
DeclarationKind
.Class:
18
case
DeclarationKind
.Script:
19
case
DeclarationKind
.ImplicitClass:
20
case
DeclarationKind
.Record:
23
case
DeclarationKind
.Submission:
26
case
DeclarationKind
.Delegate:
29
case
DeclarationKind
.Enum:
32
case
DeclarationKind
.Interface:
35
case
DeclarationKind
.Struct:
36
case
DeclarationKind
.RecordStruct:
Symbols\Source\ImplicitNamedTypeSymbol.cs (3)
24
Debug.Assert(declaration.Kind ==
DeclarationKind
.ImplicitClass ||
25
declaration.Kind ==
DeclarationKind
.Submission ||
26
declaration.Kind ==
DeclarationKind
.Script);
Symbols\Source\SourceMemberContainerSymbol.cs (15)
918
var
kind = this.declaration.Declarations[0].Kind;
919
return kind ==
DeclarationKind
.Script || kind ==
DeclarationKind
.Submission;
927
return this.declaration.Declarations[0].Kind ==
DeclarationKind
.ImplicitClass;
935
return this.declaration.Declarations[0].Kind ==
DeclarationKind
.Record;
943
return this.declaration.Declarations[0].Kind ==
DeclarationKind
.RecordStruct;
1500
if (_lazyMembersDictionary != null || declaration.MemberNames.Contains(name) || declaration.Kind is
DeclarationKind
.Record or
DeclarationKind
.RecordStruct)
1928
if (declaration.Kind !=
DeclarationKind
.Record &&
1929
declaration.Kind !=
DeclarationKind
.RecordStruct)
4175
if (declaration.Kind is not (
DeclarationKind
.Record or
DeclarationKind
.RecordStruct) && declaredMembersAndInitializers.PrimaryConstructor is null)
4183
if (declaration.Kind is not (
DeclarationKind
.Record or
DeclarationKind
.RecordStruct))
4227
bool isRecordClass = declaration.Kind ==
DeclarationKind
.Record;
Symbols\Source\SourceNamedTypeSymbol.cs (7)
78
case
DeclarationKind
.Struct:
79
case
DeclarationKind
.Interface:
80
case
DeclarationKind
.Enum:
81
case
DeclarationKind
.Delegate:
82
case
DeclarationKind
.Class:
83
case
DeclarationKind
.Record:
84
case
DeclarationKind
.RecordStruct:
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (3)
128
if (declaration.Kind ==
DeclarationKind
.Record)
370
if (declaration.Kind is
DeclarationKind
.Record or
DeclarationKind
.RecordStruct)
Symbols\Source\SourceNamespaceSymbol.cs (11)
404
case
DeclarationKind
.Namespace:
407
case
DeclarationKind
.Struct:
408
case
DeclarationKind
.Interface:
409
case
DeclarationKind
.Enum:
410
case
DeclarationKind
.Delegate:
411
case
DeclarationKind
.Class:
412
case
DeclarationKind
.Record:
413
case
DeclarationKind
.RecordStruct:
416
case
DeclarationKind
.Script:
417
case
DeclarationKind
.Submission:
418
case
DeclarationKind
.ImplicitClass:
Syntax\TypeDeclarationSyntax.cs (4)
52
internal static SyntaxKind GetTypeDeclarationKeywordKind(
DeclarationKind
kind)
56
case
DeclarationKind
.Class:
58
case
DeclarationKind
.Struct:
60
case
DeclarationKind
.Interface: