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