145 references to Any
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder_Flags.cs (1)
96
return (this.Flags.Includes(BinderFlags.UnsafeRegion) || !modifiers.
Any
(SyntaxKind.UnsafeKeyword))
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
447
return (baseMethodDeclarationSyntax.Modifiers.
Any
(SyntaxKind.StaticKeyword) ? WellKnownMemberNames.StaticConstructorName : WellKnownMemberNames.InstanceConstructorName);
Compilation\SyntaxTreeSemanticModel.cs (1)
1677
if (((ConstructorDeclarationSyntax)declaration).Modifiers.
Any
(SyntaxKind.StaticKeyword))
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (2)
58
if (constructorSyntax.Modifiers.
Any
(SyntaxKind.StaticKeyword))
128
Debug.Assert(!modifiers.
Any
(SyntaxKind.ConstKeyword)); // const locals don't have a sequence point
Parser\LanguageParser.cs (2)
4845
if (mods.
Any
(SyntaxKind.FixedKeyword))
4850
if (mods.
Any
(SyntaxKind.ConstKeyword))
Symbols\Source\LocalFunctionSymbol.cs (1)
290
firstParam.Modifiers.
Any
(SyntaxKind.ThisKeyword);
Symbols\Source\SourceConstructorSymbol.cs (1)
24
var methodKind = syntax.Modifiers.
Any
(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
87
firstParam.Modifiers.
Any
(SyntaxKind.ThisKeyword),
Syntax\AnonymousFunctionExpressionSyntax.cs (1)
38
if (Modifiers.
Any
(SyntaxKind.AsyncKeyword))
Syntax\DeclarationStatementSyntax.cs (1)
13
return this.Modifiers.
Any
(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
ConvertProgramAnalysis_TopLevelStatements.cs (2)
58
if (!methodDeclaration.Modifiers.
Any
(SyntaxKind.StaticKeyword) ||
135
if (!member.Modifiers.
Any
(SyntaxKind.StaticKeyword))
CSharpAccessibilityFacts.cs (3)
37
return ignoreDeclarationModifiers || !((MemberDeclarationSyntax)declaration).Modifiers.
Any
(SyntaxKind.FileKeyword);
55
return ignoreDeclarationModifiers || !((ConstructorDeclarationSyntax)declaration).Modifiers.
Any
(SyntaxKind.StaticKeyword);
77
if (method.Modifiers.
Any
(SyntaxKind.PartialKeyword))
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
80
if (anonymousFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword))
88
if (wasAwaited != anonymousFunction.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
CSharpSemanticFacts.cs (1)
240
return syntaxRefs.Any(static (n, cancellationToken) => ((BaseTypeDeclarationSyntax)n.GetSyntax(cancellationToken)).Modifiers.
Any
(SyntaxKind.PartialKeyword), cancellationToken);
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
39
if (localFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword))
SyntaxNodeExtensions.cs (3)
400
m => m.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword));
423
return memberDeclaration.GetModifiers().
Any
(SyntaxKind.StaticKeyword);
426
return memberDeclaration.GetModifiers().
Any
(SyntaxKind.StaticKeyword) ||
UseExpressionBodyForLocalFunctionHelper.cs (1)
56
if (statement.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
UseExpressionBodyForMethodsHelper.cs (1)
56
if (declaration.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
CSharpDeclareAsNullableCodeFixProvider.cs (1)
290
if (modifiers.
Any
(SyntaxKind.AsyncKeyword) || onYield)
CSharpFixReturnTypeCodeFixProvider.cs (2)
150
MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.
Any
(SyntaxKind.AsyncKeyword)),
153
LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.
Any
(SyntaxKind.AsyncKeyword)),
CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
84
if (otherAccessor.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
CSharpMakeTypeAbstractCodeFixProvider.cs (2)
58
!enclosingType.Modifiers.
Any
(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.
Any
(SyntaxKind.StaticKeyword))
FieldGenerator.cs (6)
26
.Where(f => f.Modifiers.
Any
(SyntaxKind.ConstKeyword))
31
if (fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword))
37
.Where(f => f.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
41
.Where(f => !f.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.
Any
(SyntaxKind.ConstKeyword))
46
return fieldDeclaration.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
503
targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword) ||
504
targetToken.GetAncestors<LocalFunctionStatementSyntax>().Any(f => f.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword)));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
1204
method.Modifiers.
Any
(SyntaxKind.StaticKeyword) &&
1205
typeDecl.Modifiers.
Any
(SyntaxKind.StaticKeyword);
2075
return fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword);
2082
return localDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
545
&& !baseFieldDeclarationNode.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword);
CompleteStatement\CompleteStatementCommandHandler.cs (3)
267
if (method.Modifiers.
Any
(SyntaxKind.AbstractKeyword) || method.Modifiers.
Any
(SyntaxKind.ExternKeyword) ||
273
if (method.Modifiers.
Any
(SyntaxKind.PartialKeyword) && method.Body is null)
Microsoft.CodeAnalysis.CSharp.Features (47)
CodeRefactorings\AddAwait\CSharpAddAwaitCodeRefactoringProvider.cs (1)
44
return ((MethodDeclarationSyntax)current).Modifiers.
Any
(SyntaxKind.AsyncKeyword);
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
86
return declarations.Any(d => d.Body == null && d.Modifiers.
Any
(SyntaxKind.PartialKeyword));
Completion\KeywordRecommenders\BaseKeywordRecommender.cs (1)
57
if (constructor.Modifiers.
Any
(SyntaxKind.StaticKeyword))
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (1)
51
if (constructor.Modifiers.
Any
(SyntaxKind.StaticKeyword))
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
70
declaration.Modifiers.
Any
(SyntaxKind.PartialKeyword);
ConvertProgramAnalysis_TopLevelStatements.cs (2)
58
if (!methodDeclaration.Modifiers.
Any
(SyntaxKind.StaticKeyword) ||
135
if (!member.Modifiers.
Any
(SyntaxKind.StaticKeyword))
CSharpDeclareAsNullableCodeFixProvider.cs (1)
290
if (modifiers.
Any
(SyntaxKind.AsyncKeyword) || onYield)
CSharpFixReturnTypeCodeFixProvider.cs (2)
150
MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.
Any
(SyntaxKind.AsyncKeyword)),
153
LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.
Any
(SyntaxKind.AsyncKeyword)),
CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
84
if (otherAccessor.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
CSharpMakeTypeAbstractCodeFixProvider.cs (2)
58
!enclosingType.Modifiers.
Any
(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.
Any
(SyntaxKind.StaticKeyword))
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
80
if (anonymousFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword))
88
if (wasAwaited != anonymousFunction.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
76
if (!memberDeclaration.IsKind(SyntaxKind.GlobalStatement) && !memberDeclaration.GetModifiers().
Any
(SyntaxKind.StaticKeyword))
EditAndContinue\BreakpointSpans.cs (3)
347
if (constructorSyntax.Modifiers.
Any
(SyntaxKind.StaticKeyword))
611
if (modifiersOpt.
Any
(SyntaxKind.ConstKeyword))
656
if (modifiersOpt.
Any
(SyntaxKind.ConstKeyword))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (6)
241
if (fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword))
981
nodeModifiers.Value.
Any
(SyntaxKind.StaticKeyword) != fieldOrPropertyModifiers.Value.
Any
(SyntaxKind.StaticKeyword))
1238
|| ((BaseTypeDeclarationSyntax)syntaxRefs.Single().GetSyntax()).Modifiers.
Any
(SyntaxKind.PartialKeyword);
2006
return declaration.Modifiers.
Any
(SyntaxKind.ConstKeyword) ? FeaturesResources.const_field : FeaturesResources.field;
2026
return ctor.Modifiers.
Any
(SyntaxKind.StaticKeyword) ? FeaturesResources.static_constructor : FeaturesResources.constructor;
EditAndContinue\SyntaxUtilities.cs (4)
249
if (property.Modifiers.
Any
(SyntaxKind.AbstractKeyword) ||
250
property.Modifiers.
Any
(SyntaxKind.ExternKeyword))
278
MethodDeclarationSyntax method => method.Modifiers.
Any
(SyntaxKind.AsyncKeyword),
279
LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.
Any
(SyntaxKind.AsyncKeyword),
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
195
=> field.DeclaringSyntaxReferences.Any(static d => d.GetSyntax().GetAncestor<FieldDeclarationSyntax>().Modifiers.
Any
(SyntaxKind.NewKeyword));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
266
return !memberDecl.Modifiers.
Any
(SyntaxKind.StaticKeyword);
ExtractMethod\CSharpSelectionResult.cs (1)
186
.Any(m => m.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword)))
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
41
MethodDeclarationSyntax method => method.Modifiers.
Any
(SyntaxKind.AsyncKeyword),
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
146
return localFunction != null && localFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
159
=> member is FieldDeclarationSyntax field && field.Modifiers.
Any
(SyntaxKind.ConstKeyword);
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
37
if (localFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword))
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
39
if (localFunction.Modifiers.
Any
(SyntaxKind.StaticKeyword))
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
135
if (setMethodDeclaration?.Modifiers.
Any
(SyntaxKind.UnsafeKeyword) == true
136
&& !property.Modifiers.
Any
(SyntaxKind.UnsafeKeyword))
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (4)
129
if (propertyDeclaration.Modifiers.
Any
(SyntaxKind.UnsafeKeyword)
130
&& !methodDeclaration.Modifiers.
Any
(SyntaxKind.UnsafeKeyword))
184
if (propertyDeclaration.Modifiers.
Any
(SyntaxKind.UnsafeKeyword)
185
&& !methodDeclaration.Modifiers.
Any
(SyntaxKind.UnsafeKeyword))
Snippets\CSharpPropgSnippetProvider.cs (1)
42
structDeclaration.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
Snippets\CSharpPropSnippetProvider.cs (1)
34
structDeclaration.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
UseExpressionBodyForLocalFunctionHelper.cs (1)
56
if (statement.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
UseExpressionBodyForMethodsHelper.cs (1)
56
if (declaration.Modifiers.
Any
(SyntaxKind.AsyncKeyword))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxTokenListTests.cs (4)
247
Assert.True(list.
Any
(SyntaxKind.SizeOfKeyword));
250
Assert.True(list.
Any
(SyntaxKind.StringLiteralToken));
253
Assert.True(list.
Any
(SyntaxKind.DotToken));
256
Assert.False(list.
Any
(SyntaxKind.NullKeyword));
Microsoft.CodeAnalysis.CSharp.Workspaces (36)
Classification\ClassificationHelpers.cs (4)
241
FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword) ? ClassificationTypeNames.ConstantName : ClassificationTypeNames.FieldName,
324
if (parentNode.GetModifiers().
Any
(SyntaxKind.ConstKeyword))
330
return parentNode.GetModifiers().
Any
(SyntaxKind.StaticKeyword);
334
=> methodDeclaration.ParameterList.Parameters.FirstOrDefault()?.Modifiers.
Any
(SyntaxKind.ThisKeyword) == true;
CSharpAccessibilityFacts.cs (3)
37
return ignoreDeclarationModifiers || !((MemberDeclarationSyntax)declaration).Modifiers.
Any
(SyntaxKind.FileKeyword);
55
return ignoreDeclarationModifiers || !((ConstructorDeclarationSyntax)declaration).Modifiers.
Any
(SyntaxKind.StaticKeyword);
77
if (method.Modifiers.
Any
(SyntaxKind.PartialKeyword))
CSharpSemanticFacts.cs (1)
240
return syntaxRefs.Any(static (n, cancellationToken) => ((BaseTypeDeclarationSyntax)n.GetSyntax(cancellationToken)).Modifiers.
Any
(SyntaxKind.PartialKeyword), cancellationToken);
FieldGenerator.cs (6)
26
.Where(f => f.Modifiers.
Any
(SyntaxKind.ConstKeyword))
31
if (fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword))
37
.Where(f => f.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword))
41
.Where(f => !f.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.
Any
(SyntaxKind.ConstKeyword))
46
return fieldDeclaration.Modifiers.
Any
(SyntaxKind.ReadOnlyKeyword)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (13)
215
if (typeDeclaration.Modifiers.
Any
(SyntaxKind.PartialKeyword) &&
228
typeDeclaration.Modifiers.
Any
(SyntaxKind.PartialKeyword),
258
enumDeclaration.Modifiers.
Any
(SyntaxKind.PartialKeyword),
286
ctorDecl.Modifiers.
Any
(SyntaxKind.PartialKeyword),
302
delegateDecl.Modifiers.
Any
(SyntaxKind.PartialKeyword),
316
enumMember.Modifiers.
Any
(SyntaxKind.PartialKeyword),
330
eventDecl.Modifiers.
Any
(SyntaxKind.PartialKeyword),
344
indexerDecl.Modifiers.
Any
(SyntaxKind.PartialKeyword),
359
method.Modifiers.
Any
(SyntaxKind.PartialKeyword),
375
property.Modifiers.
Any
(SyntaxKind.PartialKeyword),
398
fieldDeclaration.Modifiers.
Any
(SyntaxKind.PartialKeyword),
493
=> constructor.Modifiers.
Any
(SyntaxKind.StaticKeyword)
664
=> method.ParameterList.Parameters is [var parameter, ..] && parameter.Modifiers.
Any
(SyntaxKind.ThisKeyword);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (3)
400
m => m.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword));
423
return memberDeclaration.GetModifiers().
Any
(SyntaxKind.StaticKeyword);
426
return memberDeclaration.GetModifiers().
Any
(SyntaxKind.StaticKeyword) ||
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
503
targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword) ||
504
targetToken.GetAncestors<LocalFunctionStatementSyntax>().Any(f => f.GetModifiers().
Any
(SyntaxKind.UnsafeKeyword)));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
1204
method.Modifiers.
Any
(SyntaxKind.StaticKeyword) &&
1205
typeDecl.Modifiers.
Any
(SyntaxKind.StaticKeyword);
2075
return fieldDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword);
2082
return localDeclaration.Modifiers.
Any
(SyntaxKind.ConstKeyword);
Microsoft.VisualStudio.LanguageServices.CSharp (10)
CodeModel\CSharpCodeModelService.cs (6)
1876
if (modifiers.
Any
(SyntaxKind.RefKeyword))
1880
else if (modifiers.
Any
(SyntaxKind.OutKeyword))
1884
else if (modifiers.
Any
(SyntaxKind.ParamsKeyword))
3586
!classDecl.Modifiers.
Any
(SyntaxKind.StaticKeyword))
3597
return methodDeclaration.ParameterList.Parameters[0].Modifiers.
Any
(SyntaxKind.ThisKeyword);
3601
=> methodDeclaration.Modifiers.
Any
(SyntaxKind.PartialKeyword);
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (4)
121
if (parameter.Modifiers.
Any
(SyntaxKind.RefKeyword))
125
else if (parameter.Modifiers.
Any
(SyntaxKind.OutKeyword))
129
else if (parameter.Modifiers.
Any
(SyntaxKind.ParamsKeyword))
226
builder.Append(constructorDeclaration.Modifiers.
Any
(SyntaxKind.StaticKeyword) ? "#sctor" : "#ctor");