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