154 references to Any
Microsoft.AspNetCore.App.Analyzers (2)
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (2)
41&& modifiers.Any(SyntaxKind.PublicKeyword) 42&& modifiers.Any(SyntaxKind.PartialKeyword)
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Flags.cs (1)
109return !withoutUnsafe && modifiers.Any(SyntaxKind.UnsafeKeyword)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
464return (baseMethodDeclarationSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? WellKnownMemberNames.StaticConstructorName : WellKnownMemberNames.InstanceConstructorName);
Parser\LanguageParser.cs (2)
5148if (mods.Any(SyntaxKind.FixedKeyword)) 5153if (mods.Any(SyntaxKind.ConstKeyword))
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\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
189property.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
76if (anonymousFunction.Modifiers.Any(SyntaxKind.StaticKeyword)) 84if (wasAwaited != anonymousFunction.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
56if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
56if (declaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (5)
330m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword)); 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\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
236modifiers.Any(SyntaxKind.PartialKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\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))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (15)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
87if (!methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
37if (typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword))
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
145MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)), 148LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
79if (otherAccessor.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (2)
51!enclosingType.Modifiers.Any(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.Any(SyntaxKind.StaticKeyword))
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
272if (modifiers.Any(SyntaxKind.AsyncKeyword) || onYield)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (6)
29.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 34if (fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)) 40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword)) 49return fieldDeclaration.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
75if (typeNode.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
547&& !baseFieldDeclarationNode.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);
CompleteStatement\CompleteStatementCommandHandler.cs (3)
275if (method.Modifiers.Any(SyntaxKind.AbstractKeyword) || method.Modifiers.Any(SyntaxKind.ExternKeyword) || 281if (method.Modifiers.Any(SyntaxKind.PartialKeyword) && method.Body is null)
Microsoft.CodeAnalysis.CSharp.Features (41)
CodeRefactorings\AddAwait\CSharpAddAwaitCodeRefactoringProvider.cs (1)
39return methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword);
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
85return declarations.Any(d => d.Body == null && d.Modifiers.Any(SyntaxKind.PartialKeyword));
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
76=> syntax is BaseTypeDeclarationSyntax declarationSyntax && declarationSyntax.Modifiers.Any(SyntaxKind.PartialKeyword);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
317var firstConstructorIndex = currentTypeDeclaration.Members.IndexOf(m => m is ConstructorDeclarationSyntax c && !c.Modifiers.Any(SyntaxKind.StaticKeyword));
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
66declaration.Modifiers.Any(SyntaxKind.PartialKeyword);
EditAndContinue\BreakpointSpans.cs (4)
453if (constructorSyntax.Modifiers.Any(SyntaxKind.StaticKeyword)) 792if (modifiersOpt.Any(SyntaxKind.ConstKeyword)) 832if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.ConstKeyword)) 853if (variableDeclarator.Initializer == null || modifiers.Any(SyntaxKind.ConstKeyword))
EditAndContinue\SyntaxUtilities.cs (6)
46=> constructorDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword) 56when !fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword) 193if (property.Modifiers.Any(SyntaxKind.AbstractKeyword) || 194property.Modifiers.Any(SyntaxKind.ExternKeyword)) 223MethodDeclarationSyntax method => method.Modifiers.Any(SyntaxKind.AsyncKeyword), 224LocalFunctionStatementSyntax localFunction => localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword),
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
35MethodDeclarationSyntax method => method.Modifiers.Any(SyntaxKind.AsyncKeyword),
ExtractMethod\Extensions.cs (1)
128if (!modifiersGetter(decl).Any(SyntaxKind.ConstKeyword))
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
161=> member is FieldDeclarationSyntax field && field.Modifiers.Any(SyntaxKind.ConstKeyword);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
138if (setMethodDeclaration?.Modifiers.Any(SyntaxKind.UnsafeKeyword) == true 139&& !property.Modifiers.Any(SyntaxKind.UnsafeKeyword))
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (4)
131if (propertyDeclaration.Modifiers.Any(SyntaxKind.UnsafeKeyword) 132&& !methodDeclaration.Modifiers.Any(SyntaxKind.UnsafeKeyword)) 186if (propertyDeclaration.Modifiers.Any(SyntaxKind.UnsafeKeyword) 187&& !methodDeclaration.Modifiers.Any(SyntaxKind.UnsafeKeyword))
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\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
189property.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
76if (anonymousFunction.Modifiers.Any(SyntaxKind.StaticKeyword)) 84if (wasAwaited != anonymousFunction.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
56if (statement.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
56if (declaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
87if (!methodDeclaration.Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
37if (typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword))
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
145MethodDeclarationSyntax method => (method.ReturnType, method.Modifiers.Any(SyntaxKind.AsyncKeyword)), 148LocalFunctionStatementSyntax localFunction => (localFunction.ReturnType, localFunction.Modifiers.Any(SyntaxKind.AsyncKeyword)),
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
79if (otherAccessor.Modifiers.Any(SyntaxKind.ReadOnlyKeyword))
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (2)
51!enclosingType.Modifiers.Any(SyntaxKind.AbstractKeyword) && !enclosingType.Modifiers.Any(SyntaxKind.StaticKeyword))
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
272if (modifiers.Any(SyntaxKind.AsyncKeyword) || onYield)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
4057.Where(static (node) => node.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxTokenListTests.cs (4)
250Assert.True(list.Any(SyntaxKind.SizeOfKeyword)); 253Assert.True(list.Any(SyntaxKind.StringLiteralToken)); 256Assert.True(list.Any(SyntaxKind.DotToken)); 259Assert.False(list.Any(SyntaxKind.NullKeyword));
Microsoft.CodeAnalysis.CSharp.Workspaces (37)
Classification\ClassificationHelpers.cs (4)
239FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword) ? ClassificationTypeNames.ConstantName : ClassificationTypeNames.FieldName, 322if (parentNode.GetModifiers().Any(SyntaxKind.ConstKeyword)) 328return parentNode.GetModifiers().Any(SyntaxKind.StaticKeyword); 332=> methodDeclaration.ParameterList.Parameters.FirstOrDefault()?.Modifiers.Any(SyntaxKind.ThisKeyword) == true;
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (14)
214if (typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword) && 227typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword), 257enumDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword), 285ctorDecl.Modifiers.Any(SyntaxKind.PartialKeyword), 301delegateDecl.Modifiers.Any(SyntaxKind.PartialKeyword), 315enumMember.Modifiers.Any(SyntaxKind.PartialKeyword), 329eventDecl.Modifiers.Any(SyntaxKind.PartialKeyword), 343indexerDecl.Modifiers.Any(SyntaxKind.PartialKeyword), 358method.Modifiers.Any(SyntaxKind.PartialKeyword), 374property.Modifiers.Any(SyntaxKind.PartialKeyword), 388: fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword) 397fieldDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword), 492=> constructor.Modifiers.Any(SyntaxKind.StaticKeyword) 663=> method.ParameterList.Parameters is [var parameter, ..] && parameter.Modifiers.Any(SyntaxKind.ThisKeyword);
Simplification\Reducers\CSharpEscapingReducer.cs (1)
77if (enclosingMethodBlock != null && ((MethodDeclarationSyntax)enclosingMethodBlock).Modifiers.Any(SyntaxKind.AsyncKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (5)
330m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword)); 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\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
236modifiers.Any(SyntaxKind.PartialKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\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))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (6)
29.Where(f => f.Modifiers.Any(SyntaxKind.ConstKeyword)) 34if (fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword)) 40.Where(f => f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)) 44.Where(f => !f.Modifiers.Any(SyntaxKind.ReadOnlyKeyword) && !f.Modifiers.Any(SyntaxKind.ConstKeyword)) 49return fieldDeclaration.Modifiers.Any(SyntaxKind.ReadOnlyKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
506targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword) || 507targetToken.GetAncestors<LocalFunctionStatementSyntax>().Any(f => f.GetModifiers().Any(SyntaxKind.UnsafeKeyword))) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
75if (typeNode.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.Interop.ComInterfaceGenerator (5)
ComMethodInfo.cs (2)
72|| comMethodDeclaringSyntax.Modifiers.Any(SyntaxKind.SealedKeyword)) 151bool shadowsBaseMethod = comMethodDeclaringSyntax.Modifiers.Any(SyntaxKind.NewKeyword);
VtableIndexStubGenerator.cs (3)
397|| methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) 398|| methodSyntax.Modifiers.Any(SyntaxKind.SealedKeyword)) 406if (!typeDecl.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.Interop.JavaScript.JSImportGenerator (6)
JSExportGenerator.cs (3)
341|| !methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) 342|| methodSyntax.Modifiers.Any(SyntaxKind.PartialKeyword)) 350if (!typeDecl.Modifiers.Any(SyntaxKind.PartialKeyword))
JSImportGenerator.cs (3)
220|| !methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) 221|| !methodSyntax.Modifiers.Any(SyntaxKind.PartialKeyword)) 229if (!typeDecl.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.Interop.LibraryImportGenerator (2)
LibraryImportGenerator.cs (2)
547|| !methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) 548|| !methodSyntax.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
417|| !methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword) 418|| !methodSyntax.Modifiers.Any(SyntaxKind.PartialKeyword))
Microsoft.Interop.SourceGeneration (2)
SyntaxExtensions.cs (1)
124if (!typeDecl.Modifiers.Any(SyntaxKind.PartialKeyword))
TypePositionInfo.cs (1)
99IsExplicitThis = ((ParameterSyntax)paramSymbol.DeclaringSyntaxReferences[0].GetSyntax()).Modifiers.Any(SyntaxKind.ThisKeyword)
Microsoft.VisualStudio.LanguageServices.CSharp (10)
CodeModel\CSharpCodeModelService.cs (6)
1872if (modifiers.Any(SyntaxKind.RefKeyword)) 1876else if (modifiers.Any(SyntaxKind.OutKeyword)) 1880else if (modifiers.Any(SyntaxKind.ParamsKeyword)) 3581!classDecl.Modifiers.Any(SyntaxKind.StaticKeyword)) 3592return methodDeclaration.ParameterList.Parameters[0].Modifiers.Any(SyntaxKind.ThisKeyword); 3596=> methodDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword);
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (4)
120if (parameter.Modifiers.Any(SyntaxKind.RefKeyword)) 124else if (parameter.Modifiers.Any(SyntaxKind.OutKeyword)) 128else if (parameter.Modifiers.Any(SyntaxKind.ParamsKeyword)) 225builder.Append(constructorDeclaration.Modifiers.Any(SyntaxKind.StaticKeyword) ? "#sctor" : "#ctor");
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
130if (!memberSyntax.Modifiers.Any(SyntaxKind.PartialKeyword) || // TODO: Switch to using regexPropertySymbol.IsPartialDefinition when available