448 references to StaticKeyword
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Lambda.cs (1)
111
else if (modifier.IsKind(SyntaxKind.
StaticKeyword
))
Binder\Binder_Statements.cs (1)
600
if (modifier.IsKind(SyntaxKind.
StaticKeyword
))
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
464
return (baseMethodDeclarationSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
) ? WellKnownMemberNames.StaticConstructorName : WellKnownMemberNames.InstanceConstructorName);
Compilation\SyntaxTreeSemanticModel.cs (1)
1671
if (((ConstructorDeclarationSyntax)declaration).Modifiers.Any(SyntaxKind.
StaticKeyword
))
Declarations\DeclarationTreeBuilder.cs (2)
755
if (modifier.IsKind(SyntaxKind.
StaticKeyword
) && kind == DeclarationKind.Class)
1184
set.Add(((Syntax.InternalSyntax.ConstructorDeclarationSyntax)member).Modifiers.Any((int)SyntaxKind.
StaticKeyword
)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
68
if (ctorDecl.Modifiers.Any(SyntaxKind.
StaticKeyword
))
Parser\LanguageParser.cs (20)
353
case SyntaxKind.
StaticKeyword
:
963
var staticToken = this.TryEatToken(SyntaxKind.
StaticKeyword
);
967
if (staticToken is null && unsafeToken != null && this.CurrentToken.Kind == SyntaxKind.
StaticKeyword
)
970
staticToken = SyntaxFactory.MissingToken(SyntaxKind.
StaticKeyword
);
1309
case SyntaxKind.
StaticKeyword
:
2330
case SyntaxKind.
StaticKeyword
:
8281
if (tk != SyntaxKind.
StaticKeyword
) // For `static` we still need to make sure we have a typed identifier after it, because `using static type;` is a valid using directive.
8301
if (tk == SyntaxKind.
StaticKeyword
)
8782
case SyntaxKind.
StaticKeyword
:
10334
case SyntaxKind.
StaticKeyword
:
10347
case SyntaxKind.
StaticKeyword
:
10423
case SyntaxKind.
StaticKeyword
:
10592
case SyntaxKind.
StaticKeyword
:
11423
case SyntaxKind.
StaticKeyword
:
11717
while (this.PeekToken(tokenIndex).Kind == SyntaxKind.
StaticKeyword
||
12500
if (this.CurrentToken.Kind == SyntaxKind.
StaticKeyword
)
12506
this.PeekToken(1).Kind == SyntaxKind.
StaticKeyword
)
13190
if (this.CurrentToken.Kind == SyntaxKind.
StaticKeyword
)
13192
modifiers.Add(this.EatToken(SyntaxKind.
StaticKeyword
));
13217
case SyntaxKind.
StaticKeyword
:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
928
AddKeyword(SyntaxKind.
StaticKeyword
);
Symbols\Source\ModifierUtils.cs (2)
284
return SyntaxFacts.GetText(SyntaxKind.
StaticKeyword
);
342
case SyntaxKind.
StaticKeyword
:
Symbols\Source\SourceConstructorSymbol.cs (1)
21
var methodKind = syntax.Modifiers.Any(SyntaxKind.
StaticKeyword
) ? MethodKind.StaticConstructor : MethodKind.Constructor;
Symbols\Source\SourceMemberContainerSymbol.cs (3)
2792
!ContainsModifier(fieldDecl.Modifiers, SyntaxKind.
StaticKeyword
) &&
2798
!ContainsModifier(propertyDecl.Modifiers, SyntaxKind.
StaticKeyword
) &&
2808
!ContainsModifier(eventFieldDecl.Modifiers, SyntaxKind.
StaticKeyword
) &&
Syntax\SyntaxKindFacts.cs (2)
939
return SyntaxKind.
StaticKeyword
;
1587
case SyntaxKind.
StaticKeyword
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (18)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (2)
58
if (!methodDeclaration.Modifiers.Any(SyntaxKind.
StaticKeyword
) ||
135
if (!member.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
46
if (anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
39
if (localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
80
if (anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
84
public static readonly SyntaxToken StaticKeyword = Token(SyntaxKind.
StaticKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
155
SyntaxKind.
StaticKeyword
,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (4)
343
case LocalFunctionStatementSyntax localFunction when localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
):
346
case AnonymousFunctionExpressionSyntax anonymousFunction when anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
):
350
return current.GetModifiers().Any(SyntaxKind.
StaticKeyword
);
353
return property.Modifiers.Any(SyntaxKind.
StaticKeyword
) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
89
case SyntaxKind.
StaticKeyword
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (2)
55
return ignoreDeclarationModifiers || !((ConstructorDeclarationSyntax)declaration).Modifiers.Any(SyntaxKind.
StaticKeyword
);
134
SyntaxKind.
StaticKeyword
=> DeclarationModifiers.Static,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TokenComparer.cs (2)
24
x.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.
StaticKeyword
&&
25
y.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.
StaticKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
61
var directive1IsUsingStatic = using1.StaticKeyword.IsKind(SyntaxKind.
StaticKeyword
);
62
var directive2IsUsingStatic = using2.StaticKeyword.IsKind(SyntaxKind.
StaticKeyword
);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
51
!enclosingType.Modifiers.Any(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
378
=> BothHaveModifier(x, y, SyntaxKind.
StaticKeyword
, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
41
if (token is { RawKind: (int)SyntaxKind.
StaticKeyword
, Parent: UsingDirectiveSyntax })
48
token.GetPreviousToken() is { RawKind: (int)SyntaxKind.
StaticKeyword
, Parent: UsingDirectiveSyntax })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
23
SyntaxKind.
StaticKeyword
,
1218
method.Modifiers.Any(SyntaxKind.
StaticKeyword
) &&
1219
typeDecl.Modifiers.Any(SyntaxKind.
StaticKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
21
SyntaxKind.
StaticKeyword
,
41
SyntaxKind.
StaticKeyword
,
56
SyntaxKind.
StaticKeyword
,
Microsoft.CodeAnalysis.CSharp.Features (59)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
551
case SyntaxKind.
StaticKeyword
:
Completion\KeywordRecommenders\AbstractKeywordRecommender.cs (1)
32
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (2)
22
SyntaxKind.
StaticKeyword
,
35
|| context.SyntaxTree.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.
StaticKeyword
, cancellationToken)
Completion\KeywordRecommenders\BaseKeywordRecommender.cs (1)
57
if (constructor.Modifiers.Any(SyntaxKind.
StaticKeyword
))
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
23
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
22
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\ExplicitKeywordRecommender.cs (4)
16
SyntaxKind.
StaticKeyword
,
24
SyntaxKind.
StaticKeyword
,
44
modifiers.Contains(SyntaxKind.
StaticKeyword
);
53
modifiers.Contains(SyntaxKind.
StaticKeyword
);
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (3)
24
SyntaxKind.
StaticKeyword
,
35
SyntaxKind.
StaticKeyword
,
41
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\ImplicitKeywordRecommender.cs (4)
16
SyntaxKind.
StaticKeyword
,
24
SyntaxKind.
StaticKeyword
,
44
modifiers.Contains(SyntaxKind.
StaticKeyword
);
53
modifiers.Contains(SyntaxKind.
StaticKeyword
);
Completion\KeywordRecommenders\NewKeywordRecommender.cs (2)
27
SyntaxKind.
StaticKeyword
,
41
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\PartialKeywordRecommender.cs (1)
21
SyntaxKind.
StaticKeyword
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
23
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
23
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
38
SyntaxKind.
StaticKeyword
,
57
SyntaxKind.
StaticKeyword
,
75
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\RequiredKeywordRecommender.cs (1)
16
private static readonly ISet<SyntaxKind> s_validModifiers = SyntaxKindSet.AllMemberModifiers.Where(s => s is not (SyntaxKind.RequiredKeyword or SyntaxKind.
StaticKeyword
or SyntaxKind.ReadOnlyKeyword or SyntaxKind.ConstKeyword)).ToSet();
Completion\KeywordRecommenders\SealedKeywordRecommender.cs (1)
33
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (1)
77
: base(SyntaxKind.
StaticKeyword
)
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
50
if (constructor.Modifiers.Any(SyntaxKind.
StaticKeyword
))
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (5)
23
SyntaxKind.
StaticKeyword
,
39
SyntaxKind.
StaticKeyword
,
52
SyntaxKind.
StaticKeyword
,
59
SyntaxKind.
StaticKeyword
,
82
(context.IsInImportsDirective && context.TargetToken.Kind() is SyntaxKind.UsingKeyword or SyntaxKind.
StaticKeyword
);
Completion\KeywordRecommenders\VirtualKeywordRecommender.cs (1)
33
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
22
SyntaxKind.
StaticKeyword
,
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (1)
22
SyntaxKind.
StaticKeyword
,
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
317
var firstConstructorIndex = currentTypeDeclaration.Members.IndexOf(m => m is ConstructorDeclarationSyntax c && !c.Modifiers.Any(SyntaxKind.
StaticKeyword
));
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
70
if (!memberDeclaration.IsKind(SyntaxKind.GlobalStatement) && !memberDeclaration.GetModifiers().Any(SyntaxKind.
StaticKeyword
))
EditAndContinue\BreakpointSpans.cs (1)
453
if (constructorSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
))
EditAndContinue\SyntaxUtilities.cs (1)
46
=> constructorDeclaration.Modifiers.Any(SyntaxKind.
StaticKeyword
)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
251
return !memberDecl.Modifiers.Any(SyntaxKind.
StaticKeyword
);
GenerateType\CSharpGenerateTypeService.cs (1)
151
if (usingDirectiveSyntax != null && usingDirectiveSyntax.StaticKeyword.Kind() != SyntaxKind.
StaticKeyword
)
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
146
return localFunction != null && localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
301
if (localFunction != null && !localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
37
if (localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
Organizing\Organizers\MemberDeclarationsOrganizer.Comparer.cs (2)
91
var xIsStatic = x.GetModifiers().Any(SyntaxKind.
StaticKeyword
);
92
var yIsStatic = y.GetModifiers().Any(SyntaxKind.
StaticKeyword
);
Organizing\Organizers\ModifiersOrganizer.Comparer.cs (1)
43
case SyntaxKind.
StaticKeyword
:
Snippets\CSharpClassSnippetProvider.cs (1)
34
SyntaxKind.
StaticKeyword
,
Snippets\CSharpConstructorSnippetProvider.cs (2)
36
SyntaxKind.
StaticKeyword
,
46
precedingModifiers.Count == 1 && precedingModifiers.Single() == SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (2)
58
if (!methodDeclaration.Modifiers.Any(SyntaxKind.
StaticKeyword
) ||
135
if (!member.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
46
if (anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
39
if (localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
80
if (anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
))
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
51
!enclosingType.Modifiers.Any(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.Any(SyntaxKind.
StaticKeyword
))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (264)
Parsing\AnonymousFunctionParsingTests.cs (35)
186
N(SyntaxKind.
StaticKeyword
);
283
N(SyntaxKind.
StaticKeyword
);
384
N(SyntaxKind.
StaticKeyword
);
485
N(SyntaxKind.
StaticKeyword
);
486
N(SyntaxKind.
StaticKeyword
);
852
N(SyntaxKind.
StaticKeyword
);
924
N(SyntaxKind.
StaticKeyword
);
993
N(SyntaxKind.
StaticKeyword
);
1063
N(SyntaxKind.
StaticKeyword
);
1125
N(SyntaxKind.
StaticKeyword
);
1205
N(SyntaxKind.
StaticKeyword
);
1375
N(SyntaxKind.
StaticKeyword
);
1453
N(SyntaxKind.
StaticKeyword
);
1667
N(SyntaxKind.
StaticKeyword
);
1771
N(SyntaxKind.
StaticKeyword
);
1838
N(SyntaxKind.
StaticKeyword
);
2327
N(SyntaxKind.
StaticKeyword
);
2415
N(SyntaxKind.
StaticKeyword
);
2552
N(SyntaxKind.
StaticKeyword
);
2701
N(SyntaxKind.
StaticKeyword
);
2849
N(SyntaxKind.
StaticKeyword
);
3224
N(SyntaxKind.
StaticKeyword
);
3373
N(SyntaxKind.
StaticKeyword
);
3527
N(SyntaxKind.
StaticKeyword
);
3680
N(SyntaxKind.
StaticKeyword
);
3760
N(SyntaxKind.
StaticKeyword
);
3905
N(SyntaxKind.
StaticKeyword
);
4037
N(SyntaxKind.
StaticKeyword
);
4091
N(SyntaxKind.
StaticKeyword
);
4186
N(SyntaxKind.
StaticKeyword
);
4249
N(SyntaxKind.
StaticKeyword
);
4348
N(SyntaxKind.
StaticKeyword
);
4412
N(SyntaxKind.
StaticKeyword
);
4510
N(SyntaxKind.
StaticKeyword
);
4574
N(SyntaxKind.
StaticKeyword
);
Parsing\AsyncParsingTests.cs (2)
302
N(SyntaxKind.
StaticKeyword
);
791
N(SyntaxKind.
StaticKeyword
);
Parsing\AwaitParsingTests.cs (1)
2547
N(SyntaxKind.
StaticKeyword
);
Parsing\CollectionExpressionParsingTests.cs (37)
7977
N(SyntaxKind.
StaticKeyword
);
8016
N(SyntaxKind.
StaticKeyword
);
8122
N(SyntaxKind.
StaticKeyword
);
8161
N(SyntaxKind.
StaticKeyword
);
8275
N(SyntaxKind.
StaticKeyword
);
8314
N(SyntaxKind.
StaticKeyword
);
8431
N(SyntaxKind.
StaticKeyword
);
8470
N(SyntaxKind.
StaticKeyword
);
8575
N(SyntaxKind.
StaticKeyword
);
8614
N(SyntaxKind.
StaticKeyword
);
8730
N(SyntaxKind.
StaticKeyword
);
8769
N(SyntaxKind.
StaticKeyword
);
8868
N(SyntaxKind.
StaticKeyword
);
8946
N(SyntaxKind.
StaticKeyword
);
9024
N(SyntaxKind.
StaticKeyword
);
9106
N(SyntaxKind.
StaticKeyword
);
9393
N(SyntaxKind.
StaticKeyword
);
9552
N(SyntaxKind.
StaticKeyword
);
9711
N(SyntaxKind.
StaticKeyword
);
9870
N(SyntaxKind.
StaticKeyword
);
10028
N(SyntaxKind.
StaticKeyword
);
10141
N(SyntaxKind.
StaticKeyword
);
10262
N(SyntaxKind.
StaticKeyword
);
10405
N(SyntaxKind.
StaticKeyword
);
10526
N(SyntaxKind.
StaticKeyword
);
10667
N(SyntaxKind.
StaticKeyword
);
10824
N(SyntaxKind.
StaticKeyword
);
10975
N(SyntaxKind.
StaticKeyword
);
11156
N(SyntaxKind.
StaticKeyword
);
11313
N(SyntaxKind.
StaticKeyword
);
11508
N(SyntaxKind.
StaticKeyword
);
11675
N(SyntaxKind.
StaticKeyword
);
11818
N(SyntaxKind.
StaticKeyword
);
11991
N(SyntaxKind.
StaticKeyword
);
12151
N(SyntaxKind.
StaticKeyword
);
12240
N(SyntaxKind.
StaticKeyword
);
12329
N(SyntaxKind.
StaticKeyword
);
Parsing\DeclarationParsingTests.cs (10)
88
Assert.Equal(SyntaxKind.
StaticKeyword
, ud.StaticKeyword.Kind());
177
Assert.Equal(SyntaxKind.
StaticKeyword
, ud.StaticKeyword.Kind());
199
Assert.Equal(SyntaxKind.
StaticKeyword
, ud.StaticKeyword.Kind());
864
Assert.Equal(SyntaxKind.
StaticKeyword
, cs.Modifiers[0].Kind());
3556
TestClassConstructorWithModifier(SyntaxKind.
StaticKeyword
);
3745
TestClassFieldModifier(SyntaxKind.
StaticKeyword
);
3800
TestClassEventFieldModifier(SyntaxKind.
StaticKeyword
);
4651
TestClassPropertyWithModifier(SyntaxKind.
StaticKeyword
);
4846
TestClassEventPropertyWithModifier(SyntaxKind.
StaticKeyword
);
8214
N(SyntaxKind.
StaticKeyword
);
Parsing\DeclarationParsingTests_MissingIdentifiers.cs (4)
54
N(SyntaxKind.
StaticKeyword
);
61
N(SyntaxKind.
StaticKeyword
);
1986
N(SyntaxKind.
StaticKeyword
);
1993
N(SyntaxKind.
StaticKeyword
);
Parsing\DeclarationScopeParsingTests.cs (7)
1424
N(SyntaxKind.
StaticKeyword
);
1554
N(SyntaxKind.
StaticKeyword
);
1625
N(SyntaxKind.
StaticKeyword
);
1754
N(SyntaxKind.
StaticKeyword
);
3042
N(SyntaxKind.
StaticKeyword
);
3189
N(SyntaxKind.
StaticKeyword
);
11621
N(SyntaxKind.
StaticKeyword
);
Parsing\LambdaAttributeParsingTests.cs (13)
666
N(SyntaxKind.
StaticKeyword
);
885
yield return getData("[A] static x => x", tests => tests.LambdaExpression_01(SyntaxKind.
StaticKeyword
));
886
yield return getData("[A] async static x => x", tests => tests.LambdaExpression_01(SyntaxKind.AsyncKeyword, SyntaxKind.
StaticKeyword
));
887
yield return getData("[A] static async x => x", tests => tests.LambdaExpression_01(SyntaxKind.
StaticKeyword
, SyntaxKind.AsyncKeyword));
891
yield return getData("[A]static () => { }", tests => tests.LambdaExpression_02(SyntaxKind.
StaticKeyword
));
892
yield return getData("[A]async static () => { }", tests => tests.LambdaExpression_02(SyntaxKind.AsyncKeyword, SyntaxKind.
StaticKeyword
));
893
yield return getData("[A]static async () => { }", tests => tests.LambdaExpression_02(SyntaxKind.
StaticKeyword
, SyntaxKind.AsyncKeyword));
897
yield return getData("[A] static (x) => { }", tests => tests.LambdaExpression_03(SyntaxKind.
StaticKeyword
));
898
yield return getData("[A] async static (x) => { }", tests => tests.LambdaExpression_03(SyntaxKind.AsyncKeyword, SyntaxKind.
StaticKeyword
));
899
yield return getData("[A] static async (x) => { }", tests => tests.LambdaExpression_03(SyntaxKind.
StaticKeyword
, SyntaxKind.AsyncKeyword));
903
yield return getData("[A] static (object x) => { }", tests => tests.LambdaExpression_04(SyntaxKind.
StaticKeyword
));
904
yield return getData("[A] async static (object x) => { }", tests => tests.LambdaExpression_04(SyntaxKind.AsyncKeyword, SyntaxKind.
StaticKeyword
));
905
yield return getData("[A] static async (object x) => { }", tests => tests.LambdaExpression_04(SyntaxKind.
StaticKeyword
, SyntaxKind.AsyncKeyword));
Parsing\LambdaParameterParsingTests.cs (2)
759
N(SyntaxKind.
StaticKeyword
);
5276
N(SyntaxKind.
StaticKeyword
);
Parsing\LambdaReturnTypeParsingTests.cs (6)
30
yield return getModifiers("static", SyntaxKind.
StaticKeyword
);
31
yield return getModifiers("async static", SyntaxKind.AsyncKeyword, SyntaxKind.
StaticKeyword
);
32
yield return getModifiers("static async", SyntaxKind.
StaticKeyword
, SyntaxKind.AsyncKeyword);
1627
N(SyntaxKind.
StaticKeyword
);
1661
N(SyntaxKind.
StaticKeyword
);
4427
N(SyntaxKind.
StaticKeyword
);
Parsing\LocalFunctionParsingTests.cs (9)
1768
N(SyntaxKind.
StaticKeyword
);
1883
N(SyntaxKind.
StaticKeyword
);
1902
N(SyntaxKind.
StaticKeyword
);
2068
N(SyntaxKind.
StaticKeyword
);
2069
N(SyntaxKind.
StaticKeyword
);
2086
N(SyntaxKind.
StaticKeyword
);
2088
N(SyntaxKind.
StaticKeyword
);
2619
N(SyntaxKind.
StaticKeyword
);
3157
N(SyntaxKind.
StaticKeyword
);
Parsing\MemberDeclarationParsingTests.cs (60)
205
N(SyntaxKind.
StaticKeyword
);
1562
N(SyntaxKind.
StaticKeyword
);
1609
N(SyntaxKind.
StaticKeyword
);
1671
N(SyntaxKind.
StaticKeyword
);
11509
N(SyntaxKind.
StaticKeyword
);
11558
N(SyntaxKind.
StaticKeyword
);
11676
N(SyntaxKind.
StaticKeyword
);
11833
N(SyntaxKind.
StaticKeyword
);
12434
N(SyntaxKind.
StaticKeyword
);
12699
N(SyntaxKind.
StaticKeyword
);
12783
N(SyntaxKind.
StaticKeyword
);
12858
N(SyntaxKind.
StaticKeyword
);
12941
N(SyntaxKind.
StaticKeyword
);
13027
N(SyntaxKind.
StaticKeyword
);
13111
N(SyntaxKind.
StaticKeyword
);
13195
N(SyntaxKind.
StaticKeyword
);
13274
N(SyntaxKind.
StaticKeyword
);
13353
N(SyntaxKind.
StaticKeyword
);
13440
N(SyntaxKind.
StaticKeyword
);
13527
N(SyntaxKind.
StaticKeyword
);
13618
N(SyntaxKind.
StaticKeyword
);
13735
N(SyntaxKind.
StaticKeyword
);
13809
N(SyntaxKind.
StaticKeyword
);
13883
N(SyntaxKind.
StaticKeyword
);
13962
N(SyntaxKind.
StaticKeyword
);
14041
N(SyntaxKind.
StaticKeyword
);
14129
N(SyntaxKind.
StaticKeyword
);
14212
N(SyntaxKind.
StaticKeyword
);
14298
N(SyntaxKind.
StaticKeyword
);
14389
N(SyntaxKind.
StaticKeyword
);
14483
N(SyntaxKind.
StaticKeyword
);
14566
N(SyntaxKind.
StaticKeyword
);
14643
N(SyntaxKind.
StaticKeyword
);
14718
N(SyntaxKind.
StaticKeyword
);
14793
N(SyntaxKind.
StaticKeyword
);
14876
N(SyntaxKind.
StaticKeyword
);
14985
N(SyntaxKind.
StaticKeyword
);
15119
N(SyntaxKind.
StaticKeyword
);
15227
N(SyntaxKind.
StaticKeyword
);
15285
N(SyntaxKind.
StaticKeyword
);
15343
N(SyntaxKind.
StaticKeyword
);
15401
N(SyntaxKind.
StaticKeyword
);
15456
N(SyntaxKind.
StaticKeyword
);
15535
N(SyntaxKind.
StaticKeyword
);
15614
N(SyntaxKind.
StaticKeyword
);
15697
N(SyntaxKind.
StaticKeyword
);
15784
N(SyntaxKind.
StaticKeyword
);
15881
N(SyntaxKind.
StaticKeyword
);
15962
N(SyntaxKind.
StaticKeyword
);
16059
N(SyntaxKind.
StaticKeyword
);
16167
N(SyntaxKind.
StaticKeyword
);
16320
N(SyntaxKind.
StaticKeyword
);
16493
N(SyntaxKind.
StaticKeyword
);
16605
N(SyntaxKind.
StaticKeyword
);
16728
N(SyntaxKind.
StaticKeyword
);
16909
N(SyntaxKind.
StaticKeyword
);
18993
N(SyntaxKind.
StaticKeyword
);
19074
N(SyntaxKind.
StaticKeyword
);
19156
N(SyntaxKind.
StaticKeyword
);
19228
N(SyntaxKind.
StaticKeyword
);
Parsing\ParserRegressionTests.cs (6)
273
N(SyntaxKind.
StaticKeyword
);
366
N(SyntaxKind.
StaticKeyword
);
500
N(SyntaxKind.
StaticKeyword
);
590
N(SyntaxKind.
StaticKeyword
);
680
N(SyntaxKind.
StaticKeyword
);
768
N(SyntaxKind.
StaticKeyword
);
Parsing\ScriptParsingTests.cs (3)
961
NewModifier_WithOtherModifier("static", SyntaxKind.
StaticKeyword
);
1087
N(SyntaxKind.
StaticKeyword
);
2535
N(SyntaxKind.
StaticKeyword
);
Parsing\StatementParsingTests.cs (1)
684
Assert.Equal(SyntaxKind.
StaticKeyword
, ds.Modifiers[0].Kind());
Parsing\SwitchExpressionParsingTests.cs (20)
502
N(SyntaxKind.
StaticKeyword
);
587
N(SyntaxKind.
StaticKeyword
);
676
N(SyntaxKind.
StaticKeyword
);
759
N(SyntaxKind.
StaticKeyword
);
838
N(SyntaxKind.
StaticKeyword
);
926
N(SyntaxKind.
StaticKeyword
);
1021
N(SyntaxKind.
StaticKeyword
);
1103
N(SyntaxKind.
StaticKeyword
);
1182
N(SyntaxKind.
StaticKeyword
);
1276
N(SyntaxKind.
StaticKeyword
);
1383
N(SyntaxKind.
StaticKeyword
);
1478
N(SyntaxKind.
StaticKeyword
);
1557
N(SyntaxKind.
StaticKeyword
);
1640
N(SyntaxKind.
StaticKeyword
);
1717
N(SyntaxKind.
StaticKeyword
);
1791
N(SyntaxKind.
StaticKeyword
);
1867
N(SyntaxKind.
StaticKeyword
);
1943
N(SyntaxKind.
StaticKeyword
);
2023
N(SyntaxKind.
StaticKeyword
);
2109
N(SyntaxKind.
StaticKeyword
);
Parsing\TopLevelStatementsParsingTests.cs (6)
748
N(SyntaxKind.
StaticKeyword
);
1288
N(SyntaxKind.
StaticKeyword
);
1889
N(SyntaxKind.
StaticKeyword
);
2100
N(SyntaxKind.
StaticKeyword
);
2209
N(SyntaxKind.
StaticKeyword
);
2594
N(SyntaxKind.
StaticKeyword
);
Parsing\TypeArgumentListParsingTests.cs (3)
719
N(SyntaxKind.
StaticKeyword
);
874
N(SyntaxKind.
StaticKeyword
);
934
N(SyntaxKind.
StaticKeyword
);
Parsing\UsingDirectiveParsingTests.cs (26)
318
N(SyntaxKind.
StaticKeyword
);
369
N(SyntaxKind.
StaticKeyword
);
412
N(SyntaxKind.
StaticKeyword
);
472
N(SyntaxKind.
StaticKeyword
);
511
N(SyntaxKind.
StaticKeyword
);
558
N(SyntaxKind.
StaticKeyword
);
4060
M(SyntaxKind.
StaticKeyword
);
4107
M(SyntaxKind.
StaticKeyword
);
4154
M(SyntaxKind.
StaticKeyword
);
4198
M(SyntaxKind.
StaticKeyword
);
4251
M(SyntaxKind.
StaticKeyword
);
4309
M(SyntaxKind.
StaticKeyword
);
4367
M(SyntaxKind.
StaticKeyword
);
4422
M(SyntaxKind.
StaticKeyword
);
4473
N(SyntaxKind.
StaticKeyword
);
4513
N(SyntaxKind.
StaticKeyword
);
4553
N(SyntaxKind.
StaticKeyword
);
4590
N(SyntaxKind.
StaticKeyword
);
4633
N(SyntaxKind.
StaticKeyword
);
4714
N(SyntaxKind.
StaticKeyword
);
4795
N(SyntaxKind.
StaticKeyword
);
4873
N(SyntaxKind.
StaticKeyword
);
4952
N(SyntaxKind.
StaticKeyword
);
5030
N(SyntaxKind.
StaticKeyword
);
5110
N(SyntaxKind.
StaticKeyword
);
5190
N(SyntaxKind.
StaticKeyword
);
Syntax\StructuredTriviaTests.cs (2)
168
Assert.Equal(SyntaxKind.
StaticKeyword
, trivia.Token.Kind());
184
Assert.Equal(SyntaxKind.
StaticKeyword
, trivia.Token.Kind());
Syntax\SyntaxFactoryTests.cs (2)
34
var usingDirective = SyntaxFactory.UsingDirective(SyntaxFactory.Token(SyntaxKind.
StaticKeyword
), null, someValidName);
36
Assert.Equal(SyntaxKind.
StaticKeyword
, usingDirective.StaticKeyword.Kind());
Syntax\SyntaxNodeCacheTests.cs (2)
38
var child1 = new SyntaxTokenWithTrivia(SyntaxKind.
StaticKeyword
, null, null);
61
var child1 = new SyntaxTokenWithTrivia(SyntaxKind.
StaticKeyword
, null, null);
Syntax\SyntaxNodeTests.cs (1)
3446
Assert.Equal(SyntaxKind.
StaticKeyword
, newModifiers[0].Kind());
Syntax\SyntaxTreeTests.cs (6)
489
N(SyntaxKind.
StaticKeyword
);
525
N(SyntaxKind.
StaticKeyword
);
558
N(SyntaxKind.
StaticKeyword
);
607
N(SyntaxKind.
StaticKeyword
);
1257
N(SyntaxKind.
StaticKeyword
);
1267
N(SyntaxKind.
StaticKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (25)
Classification\ClassificationHelpers.cs (1)
331
return parentNode.GetModifiers().Any(SyntaxKind.
StaticKeyword
);
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
492
=> constructor.Modifiers.Any(SyntaxKind.
StaticKeyword
)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
520
return new RecommendedSymbols(usingDirective.StaticKeyword.IsKind(SyntaxKind.
StaticKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
84
public static readonly SyntaxToken StaticKeyword = Token(SyntaxKind.
StaticKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
155
SyntaxKind.
StaticKeyword
,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (4)
343
case LocalFunctionStatementSyntax localFunction when localFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
):
346
case AnonymousFunctionExpressionSyntax anonymousFunction when anonymousFunction.Modifiers.Any(SyntaxKind.
StaticKeyword
):
350
return current.GetModifiers().Any(SyntaxKind.
StaticKeyword
);
353
return property.Modifiers.Any(SyntaxKind.
StaticKeyword
) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
89
case SyntaxKind.
StaticKeyword
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (2)
55
return ignoreDeclarationModifiers || !((ConstructorDeclarationSyntax)declaration).Modifiers.Any(SyntaxKind.
StaticKeyword
);
134
SyntaxKind.
StaticKeyword
=> DeclarationModifiers.Static,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TokenComparer.cs (2)
24
x.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.
StaticKeyword
&&
25
y.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.
StaticKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
61
var directive1IsUsingStatic = using1.StaticKeyword.IsKind(SyntaxKind.
StaticKeyword
);
62
var directive2IsUsingStatic = using2.StaticKeyword.IsKind(SyntaxKind.
StaticKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (1)
378
=> BothHaveModifier(x, y, SyntaxKind.
StaticKeyword
, out comparisonResult);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
41
if (token is { RawKind: (int)SyntaxKind.
StaticKeyword
, Parent: UsingDirectiveSyntax })
48
token.GetPreviousToken() is { RawKind: (int)SyntaxKind.
StaticKeyword
, Parent: UsingDirectiveSyntax })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
23
SyntaxKind.
StaticKeyword
,
1218
method.Modifiers.Any(SyntaxKind.
StaticKeyword
) &&
1219
typeDecl.Modifiers.Any(SyntaxKind.
StaticKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (3)
21
SyntaxKind.
StaticKeyword
,
41
SyntaxKind.
StaticKeyword
,
56
SyntaxKind.
StaticKeyword
,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
1288
SyntaxKind.
StaticKeyword
,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
771
yield return CS.SyntaxFactory.Token(CS.SyntaxKind.
StaticKeyword
);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
290
else if (mod.IsKind(SyntaxKind.
StaticKeyword
))
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
31
.Where(modifier => modifier.IsKind(SyntaxKind.
StaticKeyword
))
Microsoft.Gen.Logging.Unit.Tests (1)
ParserUtilitiesTests.cs (1)
23
SyntaxFactory.Token(SyntaxKind.
StaticKeyword
),
Microsoft.Interop.ComInterfaceGenerator (10)
ComClassGenerator.cs (2)
94
Token(SyntaxKind.
StaticKeyword
),
198
.AddModifiers(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.
StaticKeyword
)));
ComInterfaceGenerator.cs (5)
518
.AddModifiers(Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.
StaticKeyword
));
640
.AddModifiers(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.
StaticKeyword
))
656
.AddModifiers(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.
StaticKeyword
)),
659
.AddModifiers(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.
StaticKeyword
))
678
.AddModifiers(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.
StaticKeyword
))
VirtualMethodPointerStubGenerator.cs (1)
167
.WithModifiers(TokenList(Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.
StaticKeyword
)))
VtableIndexStubGenerator.cs (2)
397
|| methodSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
)
443
.WithModifiers(TokenList(Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.
StaticKeyword
), Token(SyntaxKind.UnsafeKeyword)))
Microsoft.Interop.JavaScript.JSImportGenerator (11)
JSExportGenerator.cs (5)
145
.WithModifiers(TokenList(new[] { Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.
StaticKeyword
), Token(SyntaxKind.UnsafeKeyword) }))
240
.WithModifiers(TokenList(Token(SyntaxKind.
StaticKeyword
)))
246
.WithModifiers(TokenList(new[] { Token(SyntaxKind.
StaticKeyword
) }))
286
Token(SyntaxKind.
StaticKeyword
),
341
|| !methodSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
)
JSImportGenerator.cs (2)
123
.AddModifiers(Token(SyntaxKind.
StaticKeyword
));
220
|| !methodSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
)
Marshaling\FuncJSGenerator.cs (2)
117
.WithModifiers(TokenList(Token(SyntaxKind.
StaticKeyword
)))
132
.WithModifiers(TokenList(Token(SyntaxKind.
StaticKeyword
)))
Marshaling\TaskJSGenerator.cs (2)
104
.WithModifiers(TokenList(Token(SyntaxKind.
StaticKeyword
)))
127
.WithModifiers(TokenList(Token(SyntaxKind.
StaticKeyword
)))
Microsoft.Interop.LibraryImportGenerator (2)
LibraryImportGenerator.cs (2)
444
Token(SyntaxKind.
StaticKeyword
),
547
|| !methodSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
320
Token(SyntaxKind.
StaticKeyword
),
417
|| !methodSyntax.Modifiers.Any(SyntaxKind.
StaticKeyword
)
Microsoft.VisualStudio.LanguageServices.CSharp (6)
CodeModel\CSharpCodeModelService.cs (1)
3581
!classDecl.Modifiers.Any(SyntaxKind.
StaticKeyword
))
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (1)
225
builder.Append(constructorDeclaration.Modifiers.Any(SyntaxKind.
StaticKeyword
) ? "#sctor" : "#ctor");
CodeModel\ModifierFlagsExtensions.cs (2)
28
{ ModifierFlags.Static, SyntaxKind.
StaticKeyword
},
73
case SyntaxKind.
StaticKeyword
:
LanguageService\CSharpHelpContextService.cs (2)
436
text = token.GetNextToken().IsKind(SyntaxKind.
StaticKeyword
)
440
case SyntaxKind.
StaticKeyword
when token.Parent is UsingDirectiveSyntax: