168 references to StructKeyword
Microsoft.CodeAnalysis.CSharp (25)
Parser\LanguageParser.cs (13)
343
case SyntaxKind.
StructKeyword
:
1202
if (token.Kind == SyntaxKind.
StructKeyword
)
1344
case SyntaxKind.
StructKeyword
:
1424
case SyntaxKind.
StructKeyword
:
1449
Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.
StructKeyword
or SyntaxKind.InterfaceKeyword ||
1584
recordModifier = this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.
StructKeyword
1591
if (this.CurrentToken.Kind is SyntaxKind.
StructKeyword
or SyntaxKind.ClassKeyword &&
1637
case SyntaxKind.
StructKeyword
:
1671
SyntaxKind declarationKind = recordModifier?.Kind == SyntaxKind.
StructKeyword
? SyntaxKind.RecordStructDeclaration : SyntaxKind.RecordDeclaration;
1923
case SyntaxKind.
StructKeyword
:
1943
SyntaxKind.
StructKeyword
=>
2017
case SyntaxKind.
StructKeyword
:
2047
case SyntaxKind.
StructKeyword
:
SymbolDisplay\SymbolDisplayVisitor.Types.cs (3)
709
AddKeyword(SyntaxKind.
StructKeyword
);
747
AddKeyword(SyntaxKind.
StructKeyword
);
892
AddKeyword(SyntaxKind.
StructKeyword
);
Syntax\SyntaxFactory.cs (3)
2888
=> SyntaxFactory.StructDeclaration(attributeLists, modifiers, SyntaxFactory.Token(SyntaxKind.
StructKeyword
), identifier, typeParameterList, parameterList, baseList, constraintClauses, SyntaxFactory.Token(SyntaxKind.OpenBraceToken), members, SyntaxFactory.Token(SyntaxKind.CloseBraceToken), default);
2892
=> SyntaxFactory.StructDeclaration(default, default(SyntaxTokenList), SyntaxFactory.Token(SyntaxKind.
StructKeyword
), identifier, null, null, null, default, SyntaxFactory.Token(SyntaxKind.OpenBraceToken), default, SyntaxFactory.Token(SyntaxKind.CloseBraceToken), default);
2896
=> SyntaxFactory.StructDeclaration(default, default(SyntaxTokenList), SyntaxFactory.Token(SyntaxKind.
StructKeyword
), SyntaxFactory.Identifier(identifier), null, null, null, default, SyntaxFactory.Token(SyntaxKind.OpenBraceToken), default, SyntaxFactory.Token(SyntaxKind.CloseBraceToken), default);
Syntax\SyntaxKindFacts.cs (3)
809
case SyntaxKind.
StructKeyword
:
967
return SyntaxKind.
StructKeyword
;
1607
case SyntaxKind.
StructKeyword
:
Syntax\TypeDeclarationSyntax.cs (3)
59
return SyntaxKind.
StructKeyword
;
74
return SyntaxKind.
StructKeyword
;
132
return SyntaxFactory.RecordDeclaration(SyntaxKind.RecordStructDeclaration, attributes, modifiers, keyword, classOrStructKeyword: SyntaxFactory.Token(SyntaxKind.
StructKeyword
), identifier, typeParameterList, parameterList: null, baseList, constraintClauses, openBraceToken, members, closeBraceToken, semicolonToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
60
if (classOrStructKeyword.Kind() is SyntaxKind.ClassKeyword or SyntaxKind.
StructKeyword
)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
692
token.IsKind(SyntaxKind.
StructKeyword
) ||
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
99
case SyntaxKind.
StructKeyword
:
NamedTypeGenerator.cs (1)
197
var classOrStructKeyword = SyntaxFactory.Token(isRecordClass ? default : SyntaxKind.
StructKeyword
);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
EditAndContinue\TopLevelEditingTests.cs (1)
1795
Diagnostic(RudeEditKind.ModifiersUpdate, "readonly struct X", SyntaxFacts.GetText(SyntaxKind.
StructKeyword
)));
Microsoft.CodeAnalysis.CSharp.Features (5)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
84
case SyntaxKind.
StructKeyword
:
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
107
.Any(c => c.ClassOrStructKeyword.Kind() == SyntaxKind.
StructKeyword
))
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
27
: base(SyntaxKind.
StructKeyword
)
CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
60
if (classOrStructKeyword.Kind() is SyntaxKind.ClassKeyword or SyntaxKind.
StructKeyword
)
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
259
parts.Add(Keyword(SyntaxKind.
StructKeyword
));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (128)
Generated\Syntax.Test.xml.Generated.cs (4)
494
=> InternalSyntaxFactory.StructDeclaration(new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.AttributeListSyntax>(), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.SyntaxToken>(), InternalSyntaxFactory.Token(SyntaxKind.
StructKeyword
), InternalSyntaxFactory.Identifier("Identifier"), null, null, null, new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.TypeParameterConstraintClauseSyntax>(), null, new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.MemberDeclarationSyntax>(), null, null);
2727
Assert.Equal(SyntaxKind.
StructKeyword
, node.Keyword.Kind);
10470
=> SyntaxFactory.StructDeclaration(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), SyntaxFactory.Token(SyntaxKind.
StructKeyword
), SyntaxFactory.Identifier("Identifier"), default(TypeParameterListSyntax), default(ParameterListSyntax), default(BaseListSyntax), new SyntaxList<TypeParameterConstraintClauseSyntax>(), default(SyntaxToken), new SyntaxList<MemberDeclarationSyntax>(), default(SyntaxToken), default(SyntaxToken));
12703
Assert.Equal(SyntaxKind.
StructKeyword
, node.Keyword.Kind());
IncrementalParsing\IncrementalParsingTests.cs (1)
210
SyntaxKind.
StructKeyword
);
Parsing\DeclarationParsingTests.cs (51)
1324
Assert.Equal(SyntaxKind.
StructKeyword
, bound.ClassOrStructKeyword.Kind());
1695
Assert.Equal(SyntaxKind.
StructKeyword
, cs.Keyword.Kind());
2798
Assert.Equal(SyntaxKind.
StructKeyword
, structDecl.Keyword.Kind());
2845
Assert.Equal(SyntaxKind.
StructKeyword
, structDecl.Keyword.Kind());
2895
Assert.Equal(SyntaxKind.
StructKeyword
, structDecl.Keyword.Kind());
2936
Assert.Equal(SyntaxKind.
StructKeyword
, structDecl.Keyword.Kind());
7054
N(SyntaxKind.
StructKeyword
);
7145
N(SyntaxKind.
StructKeyword
);
7237
N(SyntaxKind.
StructKeyword
);
9079
N(SyntaxKind.
StructKeyword
);
9151
N(SyntaxKind.
StructKeyword
);
9416
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9446
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9466
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9490
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9522
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9559
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9595
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9630
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9672
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9711
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9766
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9814
[InlineDataAttribute(SyntaxKind.StructDeclaration, SyntaxKind.
StructKeyword
)]
9851
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9885
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9912
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9952
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
9992
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10023
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10068
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10117
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10160
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10217
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10277
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10331
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10399
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10464
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10516
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10565
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10617
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10670
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10704
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10748
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10797
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10845
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10907
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
10949
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
11001
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
11058
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
11113
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
11178
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
Parsing\DeclarationScopeParsingTests.cs (19)
11485
N(SyntaxKind.
StructKeyword
);
11504
N(SyntaxKind.
StructKeyword
);
11564
N(SyntaxKind.
StructKeyword
);
11589
N(SyntaxKind.
StructKeyword
);
11881
N(SyntaxKind.
StructKeyword
);
11920
N(SyntaxKind.
StructKeyword
);
13957
N(SyntaxKind.
StructKeyword
);
14019
N(SyntaxKind.
StructKeyword
);
14089
N(SyntaxKind.
StructKeyword
);
14175
N(SyntaxKind.
StructKeyword
);
14288
N(SyntaxKind.
StructKeyword
);
14387
N(SyntaxKind.
StructKeyword
);
14446
N(SyntaxKind.
StructKeyword
);
14507
N(SyntaxKind.
StructKeyword
);
14575
N(SyntaxKind.
StructKeyword
);
14700
N(SyntaxKind.
StructKeyword
);
14783
N(SyntaxKind.
StructKeyword
);
14845
N(SyntaxKind.
StructKeyword
);
14913
N(SyntaxKind.
StructKeyword
);
Parsing\FileModifierParsingTests.cs (12)
43
[InlineData(SyntaxKind.
StructKeyword
)]
69
[InlineData(SyntaxKind.
StructKeyword
)]
123
[InlineData(SyntaxKind.
StructKeyword
)]
221
N(SyntaxKind.
StructKeyword
);
250
N(SyntaxKind.
StructKeyword
);
313
N(SyntaxKind.
StructKeyword
);
376
N(SyntaxKind.
StructKeyword
);
439
N(SyntaxKind.
StructKeyword
);
495
[InlineData(SyntaxKind.
StructKeyword
)]
528
[InlineData(SyntaxKind.
StructKeyword
)]
1573
N(SyntaxKind.
StructKeyword
);
1837
N(SyntaxKind.
StructKeyword
);
Parsing\RecordParsing.cs (23)
2540
N(SyntaxKind.
StructKeyword
);
2640
N(SyntaxKind.
StructKeyword
);
2677
N(SyntaxKind.
StructKeyword
);
2720
N(SyntaxKind.
StructKeyword
);
3068
M(SyntaxKind.
StructKeyword
);
3113
M(SyntaxKind.
StructKeyword
);
3154
N(SyntaxKind.
StructKeyword
);
3174
N(SyntaxKind.
StructKeyword
);
3194
N(SyntaxKind.
StructKeyword
);
3398
N(SyntaxKind.
StructKeyword
);
3460
N(SyntaxKind.
StructKeyword
);
3494
N(SyntaxKind.
StructKeyword
);
3529
N(SyntaxKind.
StructKeyword
);
3551
N(SyntaxKind.
StructKeyword
);
3583
N(SyntaxKind.
StructKeyword
);
3629
N(SyntaxKind.
StructKeyword
);
3679
N(SyntaxKind.
StructKeyword
);
3705
N(SyntaxKind.
StructKeyword
);
3827
N(SyntaxKind.
StructKeyword
);
3890
N(SyntaxKind.
StructKeyword
);
3910
N(SyntaxKind.
StructKeyword
);
3953
N(SyntaxKind.
StructKeyword
);
4035
N(@struct ? SyntaxKind.
StructKeyword
: SyntaxKind.ClassKeyword);
Parsing\RefFieldParsingTests.cs (11)
28
N(SyntaxKind.
StructKeyword
);
65
N(SyntaxKind.
StructKeyword
);
106
N(SyntaxKind.
StructKeyword
);
142
N(SyntaxKind.
StructKeyword
);
176
N(SyntaxKind.
StructKeyword
);
234
N(SyntaxKind.
StructKeyword
);
299
N(SyntaxKind.
StructKeyword
);
359
N(SyntaxKind.
StructKeyword
);
409
N(SyntaxKind.
StructKeyword
);
471
N(SyntaxKind.
StructKeyword
);
560
N(SyntaxKind.
StructKeyword
);
Parsing\ScriptParsingTests.cs (1)
2414
N(SyntaxKind.
StructKeyword
);
Parsing\TopLevelStatementsParsingTests.cs (3)
3093
N(SyntaxKind.
StructKeyword
);
3112
N(SyntaxKind.
StructKeyword
);
3128
N(SyntaxKind.
StructKeyword
);
Parsing\TypeArgumentListParsingTests.cs (1)
868
N(SyntaxKind.
StructKeyword
);
Parsing\UsingDirectiveParsingTests.cs (2)
651
N(SyntaxKind.
StructKeyword
);
703
N(SyntaxKind.
StructKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
747
? SyntaxFactory.RecordDeclaration(default, modifierList, SyntaxFactory.Token(SyntaxKind.RecordKeyword), nameToken, typeParameterList, null, baseTypeList, default, structMembers).WithClassOrStructKeyword(SyntaxFactory.Token(SyntaxKind.
StructKeyword
))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
692
token.IsKind(SyntaxKind.
StructKeyword
) ||
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
99
case SyntaxKind.
StructKeyword
:
NamedTypeGenerator.cs (1)
197
var classOrStructKeyword = SyntaxFactory.Token(isRecordClass ? default : SyntaxKind.
StructKeyword
);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
489
if (token.IsKind(SyntaxKind.
StructKeyword
) && token.Parent is ClassOrStructConstraintSyntax)