579 references to Any
Aspire.Dashboard (2)
Mcp\AspireResourceMcpTools.cs (1)
170if (command.Name == CommandViewModel.RestartCommand && resource.Commands.Any(c => c.Name == CommandViewModel.StartCommand && c.State == CommandViewModelState.Enabled))
Model\ResourceMenuBuilder.cs (1)
127if (resource.Environment.Any(e => e.FromSpec))
Aspire.Hosting (2)
Dcp\DcpExecutor.cs (1)
2009if (aanns.Any(a => a.Network != KnownNetworkIdentifiers.DefaultAspireContainerNetwork))
ExternalServiceBuilderExtensions.cs (1)
160if (urlSnapshots.Any(u => string.Equals(u.Url, uri.ToString(), StringComparisons.Url)))
ConfigurationSchemaGenerator (3)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (3)
859if (current.GetMembers("Add").Any(member => 875if (current.GetMembers("Add").Any(member => 942_emitGenericParseEnum = _typeSymbols.Enum.GetMembers("Parse").Any(m => m is IMethodSymbol methodSymbol && methodSymbol.IsGenericMethod);
dotnet (8)
Commands\Project\Convert\ProjectConvertCommand.cs (1)
63bool hasRefs = evaluatedDirectives.Any(static d => d is CSharpDirective.Ref);
Commands\Run\VirtualProjectBuildingCommand.cs (4)
530if (EvaluatedDirectives.Any(static d => d is CSharpDirective.Project)) 536if (EvaluatedDirectives.Any(static d => d is CSharpDirective.Ref)) 542if (EvaluatedDirectives.Any(static d => 772if (Directives.Any(static d => d is CSharpDirective.Project or CSharpDirective.Ref))
Commands\Test\VSTest\VSTestArgumentConverter.cs (3)
337return s_blameArgList.Any(p => Eq(p, parameter)) || s_blameSwitchList.Any(p => Eq(p, parameter)); 357return s_blameSwitchList.Any(p => Eq(p, parameter));
dotnet-format (2)
Analyzers\AnalyzerFormatter.cs (2)
241.Where(analyzer => analyzer.SupportedDiagnostics.Any(descriptor => descriptor.Id == diagnosticId)) 335!analyzer.SupportedDiagnostics.Any(descriptor => diagnostics.Contains(descriptor.Id)))
GenerateDocumentationAndConfigFiles (23)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
326return methodSymbol.Parameters.Any(p => p.IsOptional); 377return method.ContainingType.AllInterfaces.Any(i => iCollectionTypes.Contains(i.OriginalDefinition)); 520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
58if (type.OriginalDefinition.AllInterfaces.Any(baseInterface => baseInterface.OriginalDefinition.Equals(parentType)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (1)
64if (linkedDocuments.Any(id => documentToLinkedDocuments.ContainsKey(id)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
503modifiers: DeclarationModifiers.None.WithIsUnsafe(!isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
71else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 91=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
ILAssembler (1)
DocumentCompiler.cs (1)
55anyErrors |= image.Diagnostics.Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error);
Microsoft.Analyzers.Extra (3)
AsyncMethodWithoutCancellation.cs (1)
132.Any(data =>
CallAnalysis\Arrays.cs (1)
115if (keyType.GetAttributes().Any(a => a.AttributeClass != null && SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttr)))
UsingToStringInLoggersAnalyzer.cs (1)
53return symbol.GetAttributes().Any(a => a.AttributeClass != null && IsLoggerMessageAttribute(a.AttributeClass));
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (1)
269if (!(method.ReducedFrom ?? method).Parameters.Any(
src\aspnetcore\src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
118var implementsIParsable = typeSymbol.AllInterfaces.Any(
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
76if (current.GetAttributes().Any(attr =>
Microsoft.AspNetCore.Components.Analyzers (5)
ComponentFacts.cs (5)
25return property.GetAttributes().Any(a => 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute)); 107return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.SupplyParameterFromFormAttribute)); 127return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.PersistentStateAttribute));
Microsoft.AspNetCore.Components.SdkAnalyzers (3)
ComponentFacts.cs (3)
25return property.GetAttributes().Any(a => 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute));
Microsoft.Build (1)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
Microsoft.CodeAnalysis (19)
CodeGen\PermissionSetAttribute.cs (1)
85Debug.Assert(((INamedTypeSymbol)iSymbol).GetMembers(HexPropertyName).Any(
CommandLine\CommonCompiler.cs (1)
1131if (HasSuppressableWarningsOrErrors(diagnostics) && analyzers.Any(a => a is DiagnosticSuppressor))
Compilation\Compilation.cs (1)
274if (previousScriptCompilation.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
383HasDiagnosticSuppressors = this.Analyzers.Any(static a => a is DiagnosticSuppressor);
DiagnosticAnalyzer\AnalyzerImageReference.cs (1)
26if (analyzers.Any(static a => a == null))
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
135if (analyzers.Any(static a => a == null)) 770if (compilationEvents.Any(e => e is SymbolDeclaredCompilationEvent) &&
MetadataReader\MetadataDecoder.cs (1)
40return !modifiers.IsDefaultOrEmpty && modifiers.Any(static m => !m.IsOptional);
Operations\ControlFlowGraphBuilder.cs (1)
6557if (operation.ConstructArguments.Any(a => a is IArgumentOperation) && !operation.ConstructArguments.All(a => a is IArgumentOperation))
Operations\OperationExtensions.cs (1)
63return model.GetDiagnostics(operation.Syntax.Span, cancellationToken).Any(static d => d.DefaultSeverity == DiagnosticSeverity.Error);
PEWriter\LocalScope.cs (2)
32Debug.Assert(!locals.Any(l => l.Name == null)); 33Debug.Assert(!constants.Any(c => c.Name == null));
PEWriter\MetadataWriter.cs (2)
4228if (!locals.Any(static variable => !variable.SlotInfo.Id.IsNone)) 4238if (!locals.Any(static variable => !variable.SlotInfo.Id.IsNone))
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
StrongName\DesktopStrongNameProvider.cs (1)
56if (!keyFileSearchPaths.IsDefault && keyFileSearchPaths.Any(static path => !PathUtilities.IsAbsolute(path)))
Syntax\LineDirectiveMap.cs (1)
119return this.Entries.Any(static e => e.State == PositionState.Hidden);
Microsoft.CodeAnalysis.Analyzers (29)
ImmutableObjectMethodAnalyzer.cs (1)
90if (!s_immutableMethodNames.Any(n => methodName.StartsWith(n, StringComparison.Ordinal)))
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (3)
206invocationOperation.Arguments.Any(arg => IsSymbolType(arg.Value, symbolType))) 218!invocationOperation.Arguments.Any(arg => IsSymbolType(arg.Value, iEqualityComparer))) 268!objectCreation.Arguments.Any(arg => IsSymbolType(arg.Value, iEqualityComparerType)))
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
228if (entry.Symbols.Any(ContainsAttributeSymbol))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
392|| namedType.GetAttributes().Any((a) =>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
326return methodSymbol.Parameters.Any(p => p.IsOptional); 377return method.ContainingType.AllInterfaces.Any(i => iCollectionTypes.Contains(i.OriginalDefinition)); 520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
58if (type.OriginalDefinition.AllInterfaces.Any(baseInterface => baseInterface.OriginalDefinition.Equals(parentType)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (1)
64if (linkedDocuments.Any(id => documentToLinkedDocuments.ContainsKey(id)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
503modifiers: DeclarationModifiers.None.WithIsUnsafe(!isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
71else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 91=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
Microsoft.CodeAnalysis.AnalyzerUtilities (22)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
392|| namedType.GetAttributes().Any((a) =>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
326return methodSymbol.Parameters.Any(p => p.IsOptional); 377return method.ContainingType.AllInterfaces.Any(i => iCollectionTypes.Contains(i.OriginalDefinition)); 520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
58if (type.OriginalDefinition.AllInterfaces.Any(baseInterface => baseInterface.OriginalDefinition.Equals(parentType)))
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
156containingMethod.Parameters.Any(p => _disposeOwnershipTransferLikelyTypes.Contains(p.Type));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (1)
126=> parameter != null && parameter.GetAttributes().Any(attr => attr.AttributeClass != null &&
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (1)
171if (!analysisEntity.Indices.Any(index => !index.IsConstant()))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.CodeStyle (22)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\roslyn\src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
141var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 159collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
83=> operation.Arms.Any(IsDefault);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
1088methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
449method.Parameters.Any(static p => p.IsRefOrOut() && p.Type.IsDelegateType())))
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
177if (members.Any(m => m is IMethodSymbol))
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
205.Any(m => m is IPropertySymbol { Type: var propertyType, Parameters: [var propertyParameter] } &&
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.CodeStyle.Fixes (18)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
95var anySymbolReferencesNotInSource = referencedSymbols.Any(static symbol => !symbol.IsFromSource());
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
349if (GetParameterTypes(cancellationToken).Any(static t => !IsValidAttributeParameterType(t))) 435var generateUnsafe = !IsContainedInUnsafeType && newParameters.Any(static p => p.RequiresUnsafeModifier());
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
94if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared))
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
48return locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
194if (semanticInfo.GetAllSymbols().Any(static s => s.Kind is SymbolKind.Local or SymbolKind.Parameter) &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
99isUnsafe = returnType.RequiresUnsafeModifier() || parameters.Any(static p => p.Type.RequiresUnsafeModifier());
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
63=> fields.Any(f => IsAssignedToField(f, parameter)) || properties.Any(p => IsAssignedToProperty(p, parameter));
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
77var isComImport = unimplementedMembers.Any(static t => t.type.IsComImport); 265return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 274var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
89if (lastCase.Clauses.Any(static c => c.CaseKind == CaseKind.Default))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (1)
64if (linkedDocuments.Any(id => documentToLinkedDocuments.ContainsKey(id)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
503modifiers: DeclarationModifiers.None.WithIsUnsafe(!isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
71else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 91=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
Microsoft.CodeAnalysis.CSharp (96)
Binder\Binder_Attributes.cs (1)
252if (attributeConstructor.Parameters.Any(static p => p.RefKind is RefKind.In or RefKind.RefReadOnlyParameter))
Binder\Binder_Expressions.cs (4)
6118if (handlerPlaceholders.Any(static placeholder => placeholder.ArgumentIndex is BoundInterpolatedStringArgumentPlaceholder.InstanceParameter or BoundInterpolatedStringArgumentPlaceholder.ExtensionReceiver)) 11500(parameters.Any(p => p.EffectiveScope != ScopedKind.None) ? parameters.SelectAsArray(p => p.EffectiveScope) : default); 11502(parameters.Any(p => p.HasUnscopedRefAttribute && p.UseUpdatedEscapeRules) ? parameters.SelectAsArray(p => p.HasUnscopedRefAttribute && p.UseUpdatedEscapeRules) : default); 11503var parameterDefaultValues = parameters.Any(p => p.HasExplicitDefaultValue) ?
Binder\Binder_InterpolatedString.cs (1)
323parts.Any(static p => p.HasErrors ||
Binder\Binder_Invocation.cs (1)
130Debug.Assert(!args.Any(static e => e.Kind == BoundKind.OutVariablePendingInference ||
Binder\DecisionDagBuilder.cs (4)
4493if (!sequence.RemainingTests.Any(t => t is SequenceTests)) 4544if (sequence.RemainingTests.Any(t => t is SequenceTests)) 4592Debug.Assert(!remainingTests.Any(t => t is AndSequence)); 4698Debug.Assert(!remainingTests.Any(t => t is OrSequence));
Binder\Semantics\Conversions\Conversions.cs (1)
95if (invoke.Parameters.Any(p => p.HasUnscopedRefAttribute))
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
414if (u.Any(isValid)) 468if (u.Any(isValid))
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3023return constraintTypes.Any(static t => isExpressionType(t.Type));
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
2715return conversionsOpt.Any(static c => c.Kind == ConversionKind.FunctionType); 4460canInfer = !extensionTypeArguments.IsDefault && !extensionTypeArguments.Any(t => !t.HasType);
BoundTree\BoundBadExpression.cs (1)
14Debug.Assert(!this.ChildBoundNodes.Any(c => Binder.IsTypeOrValueExpression(c) || Binder.IsMethodGroupWithTypeOrValueReceiver(c)));
BoundTree\BoundListPattern.cs (1)
21Debug.Assert(!Subpatterns.Any(p => p is BoundPatternWithUnionMatching));
BoundTree\UnboundLambda.cs (1)
426bool hasErrors = !types.IsDefault && types.Any(static t => t.Type?.Kind == SymbolKind.ErrorType);
CodeGen\EmitArrayInitializer.cs (1)
488if (initializers.Any(static init => init.ConstantValueOpt == null))
Compilation\CSharpCompilation.cs (1)
4415if (!memberIsReadOnly.IsDefault && memberIsReadOnly.Any(static v => !v))
Compilation\SyntaxAndDeclarationManager.cs (1)
722return externalSyntaxTrees.Any(static t => t.HasReferenceOrLoadDirectives());
CSharpCompilationOptions.cs (1)
740if (Usings != null && Usings.Any(static u => !u.IsValidClrNamespaceName()))
Emitter\Model\GenericTypeInstanceReference.cs (1)
30Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
Emitter\Model\PEModuleBuilder.cs (1)
861if (nested.Any(n => n.IsExtension))
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (1)
29Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
FlowAnalysis\NullableWalker.cs (6)
1685return compilation.SyntaxTrees.Any(static tree => ((CSharpSyntaxTree)tree).IsNullableAnalysisEnabled(new Text.TextSpan(0, tree.Length)) == true); 3832return AnonymousTypeManager.GetAnonymousTypeFieldTypes(type).Any(static t => canIgnoreAnyType(t.Type)); 4990if (members.Any(static m => m.Kind == SymbolKind.Field)) 4996if (members.Any(static m => m.Kind == SymbolKind.Property)) 7582Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection)); 7659bool parameterHasNotNullIfNotNull = !IsAnalyzingAttribute && !parametersOpt.IsDefault && parametersOpt.Any(static p => !p.NotNullIfParameterNotNull.IsEmpty);
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (1)
142if (_isEnumerable && this.method.Parameters.Any(static p => !p.IsExtensionParameterImplementation() && p.HasEnumeratorCancellationAttribute))
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
250=> variableType.GetMembers(WellKnownMemberNames.ObjectToString).Any(m => m.GetOverriddenMember() is not null);
Lowering\LocalRewriter\LocalRewriter.cs (7)
338delegateInvoke.Parameters.Any(static (p) => p.IsParamsCollection)) 394if (typeParameters.Any(static typeParameter => typeParameter.HasUnmanagedTypeConstraint)) 402typeParameters.Any(static t => t.ConstraintTypesNoUseSiteDiagnostics.Any(static t => t.ContainsNativeIntegerWrapperType()))) 410bool constraintsNeedNullableAttribute = typeParameters.Any( 420predicate(localFunction.ReturnTypeWithAnnotations) || localFunction.ParameterTypesWithAnnotations.Any(predicate); 1142symbol.Parameters.Any(static p => p.RefKind == RefKind.In))
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
980if (!sortedNodes.Any(static n => n.Kind == BoundKind.WhenDecisionDagNode)) return;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (3)
551.Any(static node => node is BoundWhenDecisionDagNode { WhenExpression: { ConstantValueOpt: null } }); 591!decisionDag.TopologicallySortedNodes.Any(static n => usesOriginalInput(n))) 618return n.Bindings.Any(static b => b.TempContainingValue.IsOriginalInput);
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
686(requiresInstanceReceiver && arguments.Any(a => usesReceiver(a))))
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
761delegateInvoke.Parameters.Any(static (p) => p.IsParamsCollection))
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
441Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection));
Lowering\SyntheticBoundNodeFactory.cs (1)
1747var discardsPresent = arguments.Any(static a => a.Kind == BoundKind.DiscardExpression);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
568return modifiers.Any(static m => !m.IsEmpty); 579return tupleSymbol.TupleElements.Any(static e => !e.IsDefaultTupleElement());
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
253if (fields.Any(static f => f.RefKind != RefKind.None))
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
790parameter.RefCustomModifiers.Any(static m => !m.IsOptional))
Symbols\MemberSymbolExtensions.cs (1)
862return method.ReturnType.ContainsTupleNames() || method.Parameters.Any(static p => p.Type.ContainsTupleNames());
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
351_packedFlags.SetIsVolatile(customModifiersArray.Any(static m => !m.IsOptional && ((CSharpCustomModifier)m).ModifierSymbol.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile));
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
365return propertyParams.Any(p => (!p.RefCustomModifiers.IsDefaultOrEmpty && p.RefCustomModifiers.Any(static m => !m.IsOptional && !m.Modifier.IsWellKnownTypeInAttribute())) ||
Symbols\MethodSymbol.cs (1)
886if (typeArguments.Any(NamedTypeSymbol.TypeWithAnnotationsIsNullFunction))
Symbols\NamedTypeSymbol.cs (1)
1444if (typeArguments.Any(TypeWithAnnotationsIsNullFunction))
Symbols\Source\CustomModifierUtils.cs (4)
160return modifiers.Any(static modifier => !modifier.IsOptional && ((CSharpCustomModifier)modifier).ModifierSymbol.IsWellKnownTypeInAttribute()); 165return modifiers.Any(static modifier => modifier.IsOptional && ((CSharpCustomModifier)modifier).ModifierSymbol.IsWellKnownTypeRequiresLocationAttribute()); 170return modifiers.Any(static modifier => !modifier.IsOptional && ((CSharpCustomModifier)modifier).ModifierSymbol.IsWellKnownTypeIsExternalInit()); 175return modifiers.Any(static modifier => !modifier.IsOptional && ((CSharpCustomModifier)modifier).ModifierSymbol.IsWellKnownTypeOutAttribute());
Symbols\Source\SourceAssemblySymbol.cs (2)
1963bool emitCompilationRelaxationsAttribute = !isBuildingNetModule && !this.Modules.Any(static m => m.HasAssemblyCompilationRelaxationsAttribute); 1983bool emitRuntimeCompatibilityAttribute = !isBuildingNetModule && !this.Modules.Any(static m => m.HasAssemblyRuntimeCompatibilityAttribute);
Symbols\Source\SourceMemberContainerSymbol.cs (11)
235Debug.Assert(containingSymbol is NamespaceSymbol { IsGlobalNamespace: true } || !declaration.Declarations.Any(static d => d.IsSimpleProgram)); 1186Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol)); 1187Debug.Assert(haveIndexers == nonTypeMembers.Any(static s => s.IsIndexer())); 1552hasDeclaredMembers = declaration.Declarations.Any(static decl => decl.HasRequiredMembers); 2011if (interfaces.Any(needsTupleElementNamesAttribute)) 2101interfaces.Any(predicate); 2503Debug.Assert(!membersByName[indexerName.AsMemory()].Any(SymbolExtensions.IsIndexer)); 3400Debug.Assert(!nonTypeMembersWithPartialImplementations.Any(static s => s is TypeSymbol)); 3542Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree && 5717return initializers.Any(static siblings => siblings.Any(static initializer => !initializer.FieldOpt.IsConst));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (4)
250reportedAnError = implementingMemberAndDiagnostics.Diagnostics.Diagnostics.Any(static d => d.Severity == DiagnosticSeverity.Error); 1426if (parameters.Any(static p => 1444else if (parameters.Any(p => (p.RefKind is RefKind.Ref or RefKind.Out) && p.Type.IsRefLikeOrAllowsRefLikeType())) 1460else if (parameters.Any(p => p.RefKind == RefKind.None && p.Type.IsRefLikeOrAllowsRefLikeType()))
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1182var foundAnyMatch = interceptorsNamespaces.Any(ns => isDeclaredInNamespace(thisNamespaceNames, ns));
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1897return this.declaration.Declarations.Any(static d => d.IsSimpleProgram); 2084|| !InstanceConstructors.Any(c => c is { ParameterCount: 0, DeclaredAccessibility: Accessibility.Internal or Accessibility.Public })
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
865else if (IsPartial && !HasExplicitAccessModifier && Parameters.Any(static p => p.RefKind == RefKind.Out))
Symbols\Source\SourcePropertySymbol.cs (1)
696if (ContainingType.TypeParameters.Any(static tp => tp.Name == ParameterSymbol.ValueParameterName))
Symbols\Source\SourceTypeParameterSymbol.cs (2)
307&& ConstraintTypesNoUseSiteDiagnostics.Any(static t => t.ContainsNativeIntegerWrapperType())) 331if (this.ConstraintTypesNoUseSiteDiagnostics.Any(static c => c.NeedsNullableAttribute()))
Symbols\Symbol_Attributes.cs (1)
381Debug.Assert(!boundAttributes.Any(static (attr) => attr == null));
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
100return containingType.IsReadOnly || (containingType.IsRecordStruct && !positionalMembers.Any(static m => hasNonReadOnlyGetter(m)));
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
124printableMembers.Any(static m => m.GetTypeOrReturnType().Type.IsErrorType()))
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
252compilation.SyntaxTrees.Any(static tree => ((CSharpSyntaxTree)tree).IsNullableAnalysisEnabled(new TextSpan(0, tree.Length)) == true);
Symbols\TypeSymbol.cs (1)
1107return !symbolAndDiagnostics.Diagnostics.Diagnostics.Any(static d => d.Code == (int)ErrorCode.ERR_MostSpecificImplementationIsNotFound);
Symbols\VarianceSafety.cs (2)
94Debug.Assert(container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None)); 111if (container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None))
Utilities\TypeUnionValueSet.cs (2)
67Debug.Assert(!typesInUnion.Any(t => t.CaseType.IsNullableType())); 93Debug.Assert(!typesInUnion.Any(t => t.CaseType.IsNullableType()));
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
243!argumentType.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
278if (type.AllInterfaces.Any(t => t.OriginalDefinition.Equals(isetType) || t.OriginalDefinition.Equals(ireadOnlySetType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
291if (!addMethods.Any(m => m.Parameters is [{ Type: var parameterType }] && Equals(parameterType, elementType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
97if (symbols.Any(s => s.IsAccessibleWithin(containingType)) ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out)) 369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType)) 575if (symbols.Any(s => !Equals(s, parameter) && !Equals(s, member)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
78if (leadingDirectives.Any(t => t.Kind() == SyntaxKind.EndIfDirectiveTrivia))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
535return symbolInfo.GetBestOrAllSymbols().Any() && !symbolInfo.GetBestOrAllSymbols().Any(static s => s is IMethodSymbol);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
303if (positionalParameterInfos.Any(info => info.IsInherited))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
56.Any(symbol => symbol.SetMethod is IMethodSymbol { IsInitOnly: true });
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1038var anyGeneric = symbols.Any(static s =>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
639if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 758var maxParameterCount = parameterList.Any(p => p.IsParams) ? int.MaxValue : parameterList.Length; 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate))
Microsoft.CodeAnalysis.CSharp.Features (26)
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (1)
67return info.CandidateSymbols.Any(static s => s.GetArity() > 0);
CodeRefactorings\NodeSelectionHelpers.cs (1)
61return members.Any(m => m is GlobalStatementSyntax or IncompleteMemberSyntax)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
605if (!fixAllSpans.Any(fixAllSpan => fixAllSpan.Contains(originalNode.Span)))
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (2)
45if (nameInfo.PossibleSymbolKinds.Any(static k => k.SymbolKind == SymbolKind.Parameter)) 222=> namespaceSymbol != null && namespaceSymbol.GetTypeMembers(name).Any(static t => t.DeclaredAccessibility == Accessibility.Public);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
172if (fieldOrProperty is IPropertySymbol property && property.Parameters.Any(static p => !p.IsOptional))
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
121var preselect = symbols.Any(static t => t.Preselect);
Completion\CompletionProviders\SymbolCompletionProvider.cs (2)
214var preselect = symbols.Any(static t => t.Preselect); 251var isInferredTypeDelegateOrFunctionPointer = context.InferredTypes.Any(static type => type.IsDelegateType() || type.IsFunctionPointerType());
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
32=> !operation.SemanticModel.AnalyzeControlFlow(operation.Syntax).ExitPoints.Any(static n => n.IsKind(SyntaxKind.BreakStatement));
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
93!_semanticModel.GetDiagnostics(_source.Span, _cancellationToken).Any(static diagnostic => diagnostic.DefaultSeverity == DiagnosticSeverity.Error))
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (1)
351c => !extensionMethodInfo.MethodTypeParameters.Any(t => t.Name == c.Name.Identifier.ValueText))];
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
191=> field.DeclaringSyntaxReferences.Any(static d => d.GetSyntax().GetAncestor<FieldDeclarationSyntax>().Modifiers.Any(SyntaxKind.NewKeyword));
ExtractMethod\CSharpSelectionResult.cs (1)
134=> exitPoints.Any(n => n is not (BreakStatementSyntax or ContinueStatementSyntax or ReturnStatementSyntax));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
62semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static s => s is not INamedTypeSymbol);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
243!argumentType.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
278if (type.AllInterfaces.Any(t => t.OriginalDefinition.Equals(isetType) || t.OriginalDefinition.Equals(ireadOnlySetType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
291if (!addMethods.Any(m => m.Parameters is [{ Type: var parameterType }] && Equals(parameterType, elementType)))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
97if (symbols.Any(s => s.IsAccessibleWithin(containingType)) ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out)) 369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType)) 575if (symbols.Any(s => !Equals(s, parameter) && !Equals(s, member)))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
303if (positionalParameterInfos.Any(info => info.IsInherited))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
56.Any(symbol => symbol.SetMethod is IMethodSymbol { IsInitOnly: true });
Testing\CSharpTestMethodFinder.cs (1)
48var matches = TestFrameworkMetadata.Any(metadata => metadata.MatchesAttributeSyntacticName(attributeName));
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
207return diagnostics.Any(static d => d.Id is CS0165 or CS0103);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocations.Analyzer.cs (1)
36return arguments.Any(a =>
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Simplification\CSharpSimplificationService.Expander.cs (1)
741if (!typeArguments.Any(static t => t.ContainsAnonymousType()))
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
227return scopes.Any(static s => s.Aliases.Length > 0); 409return symbols.Any(static s => s is ILocalSymbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
78if (leadingDirectives.Any(t => t.Kind() == SyntaxKind.EndIfDirectiveTrivia))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
535return symbolInfo.GetBestOrAllSymbols().Any() && !symbolInfo.GetBestOrAllSymbols().Any(static s => s is IMethodSymbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1038var anyGeneric = symbols.Any(static s =>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
639if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 758var maxParameterCount = parameterList.Any(p => p.IsParams) ? int.MaxValue : parameterList.Length; 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate))
Microsoft.CodeAnalysis.Extensions.Package (8)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.Features (73)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (2)
92parametersForSelectedMembers.WhereAsArray(t => !constructor.Parameters.Any(p => t.parameter.Name == p.Name)))); 115!constructorParams.Any(static p => p.IsParams) &&
ChangeSignature\AbstractChangeSignatureService.cs (2)
149if (symbol.Locations.Any(static loc => loc.IsInMetadata)) 281if (symbol.Definition.Locations.Any(static loc => loc.IsInMetadata))
CodeLens\CodeLensFindReferenceProgress.cs (1)
125!definition.Locations.Any(static loc => loc.IsInSource);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
65Debug.Assert(parts.IsEmpty || parts.Any(static s => s.IndexOfAny(Path.GetInvalidPathChars()) < 0));
Completion\CompletionService_GetCompletions.cs (1)
100if (!triggeredContexts.Any(static cc => cc.Items.Count > 0))
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
150return namedType.GetTypeMembers().Any(IsValidForGenericConstraintContext); 170var preselect = symbols.Any(static t => t.Preselect);
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
307var preselect = symbols.Any(static t => t.Preselect);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
172=> aliases.IsEmpty || aliases.Any(static alias => alias == MetadataReferenceProperties.GlobalAlias);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
128if (!sections.Any(static section => section.Labels.IsDefault)) 132if (!sections.Any(static section => GetSwitchArmKind(section.Body) == OperationKind.Return)) 241if (!fixAllSpans.Any(fixAllSpan => fixAllSpan.Contains(originalIfStatement.Span)))
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
94.Any(static diagnostic => diagnostic.DefaultSeverity == DiagnosticSeverity.Error))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
76var containsAnonymousType = fields.Any(static p => p.Type.ContainsAnonymousType()); 135if (!capturedTypeParameters.Any(static tp => tp.TypeParameterKind == TypeParameterKind.Method)) 144if (!capturedTypeParameters.Any(static tp => tp.TypeParameterKind == TypeParameterKind.Type))
Debugging\AbstractBreakpointResolver.cs (1)
270if ((methodOrProperty.Language == _language) && methodOrProperty.Locations.Any(static location => location.IsInSource))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
3775if (otherMembersOfParameterName.Any(static m => m is IPropertySymbol)) 4146return memberWithInitializer.ContainingType.Constructors.Any( 5423parameter.ContainingType.GetMembers($"<{parameter.Name}>P").Any(m => m.Kind == SymbolKind.Field);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (1)
297=> diagnostics.Any(static e => e.Kind.IsBlocking());
EditAndContinue\EmitSolutionUpdateResults.cs (1)
212.Where(r => r.Diagnostics.Any(static d => d.Severity == DiagnosticSeverity.Error))
EditAndContinue\Utilities\Extensions.cs (2)
211=> !type.InstanceConstructors.Any(static c => !(c.Parameters is [] || c.ContainingType.IsRecord && c.IsCopyConstructor())); 280=> type.GetMembers().Any(static member => member.ExplicitInterfaceImplementations().Any());
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
66where method.Parameters.Any(static p => p.Name == _patternName)
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
99if (selectedMemberNodes.Any(m => m.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsTypeDeclaration) != containingTypeDeclarationNode))
ExtractMethod\MethodExtractor.Analyzer.cs (1)
94var isThisParameterWritten = dataFlowAnalysisData.WrittenInside.Any(static s => IsThisParameter(s));
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
319if (variables.Any(v => v.ReturnBehavior == ReturnBehavior.Initialization) ||
FindUsages\DefinitionItemFactory.cs (2)
172if (!definition.Locations.Any(static location => location.MetadataModule != null)) 201if (!constituentNamespace.Locations.Any(static location => location.MetadataModule != null))
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
241var canAddNullCheck = viableMembers.Any(
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (2)
61if (mappedMembers.Any(m => m is null)) 104where c.Parameters.All(p => p.RefKind == RefKind.None) && !c.Parameters.Any(static p => p.IsParams)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (2)
161.Any(m => m is IMethodSymbol { Parameters.Length: 1, IsStatic: false, IsImplicitlyDeclared: false }); 165.Any(m => m is IMethodSymbol { Parameters.Length: 0, IsStatic: false, IsImplicitlyDeclared: false });
GoToBase\AbstractGoToBaseService.cs (1)
74else if (baseSymbol.Locations.Any(static l => l.IsInMetadata))
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
320var derivedSymbols = allDerivedSymbols.WhereAsArray(symbol => symbol.Locations.Any(static l => l.IsInSource)); 365var implementingSymbols = allImplementingSymbols.WhereAsArray(symbol => symbol.Locations.Any(static l => l.IsInSource)); 392var overridingSymbols = allOverridingSymbols.WhereAsArray(symbol => symbol.Locations.Any(static l => l.IsInSource));
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
443if (parameterType.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttributeType)))
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
79useDecompiler = !symbol.ContainingAssembly.GetAttributes().Any(static attribute => attribute.AttributeClass?.Name == nameof(SuppressIldasmAttribute)
MetadataAsSource\MetadataAsSourceFileService.cs (1)
292if (!symbol.Locations.Any(static l => l.IsInMetadata))
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
52if (selectedMembers.Any(m => !m.ContainingType.Equals(containingType)))
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
50if (selectedMembers.Any(m => !m.ContainingType.Equals(containingType)))
PullMemberUp\MembersPuller.cs (1)
354result.MemberAnalysisResults.Any(static analysis => analysis.Member.IsAbstract || analysis.MakeMemberDeclarationAbstract))
PullMemberUp\PullMembersUpOptions.cs (1)
38PullUpOperationNeedsToDoExtraChanges = MemberAnalysisResults.Any(static result => result.PullMemberUpNeedsToDoExtraChanges);
ReplaceMethodWithProperty\AbstractReplaceMethodWithPropertyService.cs (1)
35if (current.Locations.Any(static loc => loc.IsInMetadata))
Shared\Utilities\ExtractTypeHelpers.cs (1)
192if (includedMembers.Any(m => DoesMemberReferenceTypeParameter(m, typeParameter, [])))
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\roslyn\src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
141var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 159collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
83=> operation.Arms.Any(IsDefault);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
1088methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
449method.Parameters.Any(static p => p.IsRefOrOut() && p.Type.IsDelegateType())))
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
177if (members.Any(m => m is IMethodSymbol))
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
205.Any(m => m is IPropertySymbol { Type: var propertyType, Parameters: [var propertyParameter] } &&
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
95var anySymbolReferencesNotInSource = referencedSymbols.Any(static symbol => !symbol.IsFromSource());
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
349if (GetParameterTypes(cancellationToken).Any(static t => !IsValidAttributeParameterType(t))) 435var generateUnsafe = !IsContainedInUnsafeType && newParameters.Any(static p => p.RequiresUnsafeModifier());
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
94if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared))
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
48return locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
194if (semanticInfo.GetAllSymbols().Any(static s => s.Kind is SymbolKind.Local or SymbolKind.Parameter) &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
99isUnsafe = returnType.RequiresUnsafeModifier() || parameters.Any(static p => p.Type.RequiresUnsafeModifier());
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
63=> fields.Any(f => IsAssignedToField(f, parameter)) || properties.Any(p => IsAssignedToProperty(p, parameter));
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
77var isComImport = unimplementedMembers.Any(static t => t.type.IsComImport); 265return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 274var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
89if (lastCase.Clauses.Any(static c => c.CaseKind == CaseKind.Default))
UnusedReferences\UnusedReferencesRemover.cs (1)
233return reference.Dependencies.Any(HasAnyCompilationAssembly);
ValueTracking\ValueTracker.cs (1)
251return methodSymbol.Parameters.Any(static p => p.IsRefOrOut());
Microsoft.CodeAnalysis.Razor.Compiler (12)
CSharp\CompilationExtensions.cs (2)
13.Any(static t => 16.Any(static m => m.DeclaredAccessibility == Accessibility.Public));
Language\Components\ComponentNodeWriter.cs (1)
73return node.Diagnostics.Any(d => d.Id == ComponentDiagnosticFactory.GenericComponentTypeInferenceUnderspecified.Id);
Language\DefaultTagHelperResolutionPhase.cs (1)
455if (boundRulesInfo.Rules.Any(static rule => rule.TagStructure == TagStructure.WithoutEndTag))
Language\SymbolCache.AssemblySymbolData.cs (1)
34assembly.Modules.First().ReferencedAssemblies.Any(
Language\TagHelperObject`1.cs (1)
19=> Diagnostics.Any(static d => d.Severity == RazorDiagnosticSeverity.Error);
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (2)
200pb.IsEditorRequired = property.GetAttributes().Any( 670if (!property.GetAttributes().Any(static a => a.HasFullName(ComponentsApi.ParameterAttribute.MetadataName)))
Language\TagHelpers\Producers\FormNameTagHelperProducer.Factory.cs (1)
41.Any(static m => m.DeclaredAccessibility == Accessibility.Public);
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (1)
219else if (parameter.Type.AllInterfaces.Any(s => SymbolEqualityComparer.Default.Equals(s.ConstructedFrom, _iDictionarySymbol)))
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (1)
234else if (parameter.Type.AllInterfaces.Any(s => SymbolEqualityComparer.Default.Equals(s.ConstructedFrom, _iDictionarySymbol)))
Mvc\ViewComponentTagHelperDescriptorFactory.cs (1)
237else if (parameter.Type.AllInterfaces.Any(s => SymbolEqualityComparer.Default.Equals(s.ConstructedFrom, _iDictionarySymbol)))
Microsoft.CodeAnalysis.Rebuild (1)
CompilationOptionsReader.cs (1)
449public bool HasEmbeddedPdb => PeReader.ReadDebugDirectory().Any(static entry => entry.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
392|| namedType.GetAttributes().Any((a) =>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
326return methodSymbol.Parameters.Any(p => p.IsOptional); 377return method.ContainingType.AllInterfaces.Any(i => iCollectionTypes.Contains(i.OriginalDefinition)); 520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
58if (type.OriginalDefinition.AllInterfaces.Any(baseInterface => baseInterface.OriginalDefinition.Equals(parentType)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.Workspaces (55)
CodeFixes\CodeFixContext.cs (1)
245if (diagnostics.Any(static d => d == null))
Diagnostics\DiagnosticAnalyzerInfoCache.cs (2)
59public readonly bool HasCompilationEndDescriptor = supportedDescriptors.Any(DiagnosticDescriptorExtensions.IsCompilationEnd); 166descriptors.Length > 0 && descriptors[0].ImmutableCustomTags().Any(static t => t == WellKnownDiagnosticTags.Telemetry);
Editing\SyntaxGenerator.cs (1)
244method.Parameters.Any(p => p.Type.GetReferencedTypeParameters().Any(t => IsNullableAnnotatedTypeParameter(typeParameter, t)));
FindSymbols\FindReferences\DependentProjectsFinder.cs (2)
46if (symbols.Any(static s => s is INamespaceSymbol or IPreprocessingSymbol or IDynamicTypeSymbol)) 130var project = assembly.Locations.Any(static loc => loc.IsInMetadata)
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
74var searchInMetadata = type.Locations.Any(s_isInMetadata); 364derivedType.Locations.Any(s_isInMetadata) &&
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (3)
97return symbol.ContainingType.AllInterfaces.Any(a => a.OriginalDefinition.IsIEnumerableOfT()) && 98symbol.ContainingType.GetBaseTypesAndThis().Any(t => t.GetMembers(nameof(IList<>.Add)).Any(m => m is IMethodSymbol { IsStatic: false, Parameters.Length: 1 })); 260var exactArgumentCount = symbol.Parameters.Any(static p => p.IsOptional || p.IsParams)
FindSymbols\FindReferences\MetadataUnifyingEquivalenceComparer.cs (1)
51=> symbol.Locations.Any(static l => l.IsInSource);
FindSymbols\SymbolFinder.cs (1)
232c => c.DeclaringSyntaxReferences.Any(r => linkedNode.Equals(r.GetSyntax(cancellationToken))));
FindSymbols\SymbolFinder_Helpers.cs (1)
18if (symbol.Locations.Any(static l => l.IsInMetadata))
PatternMatching\RegexQuery.cs (2)
44public override bool HasLiterals => Children.Any(static c => c.HasLiterals); 54public override bool HasLiterals => Children.Any(static c => c.HasLiterals);
Recommendations\AbstractRecommendationServiceRunner.cs (1)
136if (!parameterTypeSymbols.Any(static t => t.IsKind(SymbolKind.TypeParameter)))
Rename\ConflictEngine\ConflictResolver.cs (1)
165return conflictResolution.ReplacementTextValid && renamedSymbol != null && renamedSymbol.Locations.Any(static loc => loc.IsInSource);
Rename\IRemoteRenamerService.cs (1)
131if (referencedSymbols.Any(s => s is null))
Rename\LightweightRenameLocations.cs (1)
54if (referencedSymbols.Any(s => s is null))
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
69referencedSymbol.Locations.Any(static loc => loc.IsInSource))
Shared\Extensions\IFindReferencesResultExtensions.cs (2)
82if (definition.Locations.Any(static loc => loc.IsInSource)) 88definition.Locations.Any(static loc => loc.IsInMetadata))
Shared\Extensions\ISymbolExtensions.cs (1)
670(s is INamespaceSymbol || s.Locations.Any(static loc => loc.IsInSource) || !s.HasUnsupportedMetadata) &&
Shared\Extensions\ITypeSymbolExtensions.cs (2)
158typeSymbol.Locations.Any(static location => location.IsInSource)) || 179type.AllInterfaces.Any(s => s.SpecialType is SpecialType.System_Collections_Generic_IEnumerable_T or SpecialType.System_Collections_IEnumerable);
Shared\Extensions\TelemetryExtensions.cs (1)
56if (diagnostic.Descriptor.ImmutableCustomTags().Any(static t => t == WellKnownDiagnosticTags.Telemetry))
SourceGeneration\SourceGeneratorExtensions.cs (1)
39var hasRequiredGenerators = generators.Any(g => g.IsRequiredGenerator());
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (1)
64if (linkedDocuments.Any(id => documentToLinkedDocuments.ContainsKey(id)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
503modifiers: DeclarationModifiers.None.WithIsUnsafe(!isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
71else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 91=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
Workspace\ProjectSystem\IFileChangeWatcher.cs (2)
39if (extensionFilters.Any(static filter => !filter.StartsWith("."))) 64if (watchedDirectory.ExtensionFilters.Length == 0 || watchedDirectory.ExtensionFilters.Any(filter => filePath.EndsWith(filter, stringComparison)))
Workspace\Solution\ProjectState.cs (3)
871Debug.Assert(!documents.Any(d => DocumentStates.Contains(d.Id))); 883Debug.Assert(!documents.Any(d => AdditionalDocumentStates.Contains(d.Id))); 895Debug.Assert(!documents.Any(d => AnalyzerConfigDocumentStates.Contains(d.Id)));
Workspace\Solution\SolutionCompilationState.cs (2)
820if (!texts.Any(static t => t.documentId.IsSourceGenerated)) 1025if (!syntaxRoots.Any(static t => t.documentId.IsSourceGenerated))
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
498if (!priorRunResult.Results.Any(r => r.Generator == context.Generator && !r.GeneratedSources.IsDefault))
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\BuildHostProjectFileInfoProvider.cs (1)
37if (diagnosticItems.Any(d => d.Kind == DiagnosticLogItemKind.Error))
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
343return outputFilePaths.Any(path => builder.Contains(path) && File.Exists(path));
Microsoft.Diagnostics.DataContractReader.DataGenerator (2)
Parser.cs (2)
232bool usePropertyName = !fieldAttr.NamedArguments.Any(kv => kv.Key == "UsePropertyName" && kv.Value.Value is false); 264bool usePropertyName = !addrAttr.NamedArguments.Any(kv => kv.Key == "UsePropertyName" && kv.Value.Value is false);
Microsoft.DotNet.ApiSymbolExtensions (4)
Filtering\ImplicitSymbolFilter.cs (3)
39method.ExplicitInterfaceImplementations.Any(m => m is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet or MethodKind.EventAdd or MethodKind.EventRemove })) 52type.GetAttributes().Any(a => a.AttributeClass?.Name == "EmbeddedAttribute" && a.AttributeClass?.ContainingNamespace.ToDisplayString() == "Microsoft.CodeAnalysis"))) 79return !recordConstructor.Parameters.Any(p => p.Name == symbol.Name);
SymbolExtensions.cs (1)
66return symbol.GetAttributes().Any(attribute =>
Microsoft.DotNet.HotReload.Utils.Generator (1)
DeltaProject.cs (1)
98if (updates.PersistentDiagnostics.Any(d => d.Severity == DiagnosticSeverity.Error)) {
Microsoft.DotNet.ProjectTools (2)
VirtualProjectBuilder.cs (2)
206if (!directives.Any(static d => d is CSharpDirective.Project or CSharpDirective.IncludeOrExclude or CSharpDirective.Ref)) 415if (!directives.Any(static directive => directive is CSharpDirective.Sdk))
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
737.Any(ds => ds.GetSyntax() is ClassDeclarationSyntax));
Microsoft.Extensions.Options.SourceGeneration (1)
ParserUtilities.cs (1)
36.Any(x =>
Microsoft.Gen.BuildMetadata (1)
src\Generators\Shared\ParserUtilities.cs (1)
41.Any(x =>
Microsoft.Gen.ContextualOptions (3)
ContextReceiver.cs (1)
49.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
ContextualOptionsGenerator.cs (1)
41.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute)))
Parser.cs (1)
54if (!type.Definitions.Any(def => def.Modifiers.Any(static token => token.IsKind(SyntaxKind.PartialKeyword))))
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (1)
710.Any(ds => ds.GetSyntax() is ClassDeclarationSyntax));
src\Generators\Shared\ParserUtilities.cs (1)
41.Any(x =>
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Shared\ParserUtilities.cs (1)
41.Any(x =>
Microsoft.Gen.Metrics (1)
src\Generators\Shared\ParserUtilities.cs (1)
41.Any(x =>
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\ParserUtilities.cs (1)
41.Any(x =>
Microsoft.Interop.ComInterfaceGenerator (14)
Analyzers\AddGeneratedComClassAnalyzer.cs (3)
36if (type.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 49if (iface.GetAttributes().Any(attr => generatedComInterfaceAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 57&& type.BaseType.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ComClassGeneratorDiagnosticsAnalyzer.cs (1)
52if (!classToAnalyze.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, generatedComClassAttributeType)))
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (2)
53if (containingType.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 61if (iface.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
130mayRequireAdditionalWork |= generatorDiagnostics.Any(diag => diag.IsFatal);
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
37sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))); 41sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)));
Analyzers\VtableIndexStubDiagnosticsAnalyzer.cs (1)
135if (!method.ContainingType.GetAttributes().Any(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute)))
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
241&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 250&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 271&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute))
VtableIndexStubGenerator.cs (1)
355bool implementsIUnmanagedInterfaceOfSelf = symbol.ContainingType.AllInterfaces.Any(iface => SymbolEqualityComparer.Default.Equals(iface, expectedUnmanagedInterfaceType));
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
172mayRequireAdditionalWork |= bindingFailures.Any(d => d.IsFatal);
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
241&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 250&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 271&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute))
Microsoft.Interop.SourceGeneration (6)
CompilationExtensions.cs (2)
17if (compilation.SourceModule.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_CompilerServices_SkipLocalsInitAttribute)) 21if (compilation.Assembly.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.System_Runtime_CompilerServices_DisableRuntimeMarshallingAttribute))
ManualTypeMarshallingHelper.cs (2)
86&& entryPointType.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.ContiguousCollectionMarshallerAttribute); 91return entryPointType.GetAttributes().Any(attr => attr.AttributeClass.ToDisplayString() == TypeNames.CustomMarshallerAttribute);
SignatureContext.cs (2)
156if (method.GetAttributes().Any(IsSkipLocalsInitAttribute)) 163if (type.GetAttributes().Any(IsSkipLocalsInitAttribute))
Microsoft.ML.InternalCodeAnalyzer (3)
BestFriendAnalyzer.cs (2)
99assemblyWantsBestFriends = symbolAssembly.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, wantsToBeBestFriendsAttributeType)); 104if (symbol.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, bestFriendAttributeType)))
InstanceInitializerAnalyzer.cs (1)
49if (symbol.GetAttributes().Any(i => i.AttributeClass.Name == "ArgumentAttribute"))
NuGet.Commands (1)
RestoreCommand\CompatibilityChecker.cs (1)
326!compatibilityData.Files.Any(p =>
NuGet.PackageManagement (2)
NuGetPackageManager.cs (2)
3193.Where(e => e.Dependencies.Any(a => string.Equals(a.Name, packageIdentityId, StringComparison.OrdinalIgnoreCase))) 3199.Where(e => !e.Dependencies.Any(a => string.Equals(a.Name, packageIdentityId, StringComparison.OrdinalIgnoreCase)))
NuGet.Packaging (1)
Rules\MisplaceAssemblyOutsideLibRule.cs (1)
39if (!ValidFolders.Any(folder => file.StartsWith(folder, StringComparison.OrdinalIgnoreCase)))
NuGet.ProjectModel (3)
PackageSpecOperations.cs (3)
44if (!targetFramework.Dependencies.Any(dep => IsMatchingDependencyName(dep, dependencyId))) 102if (spec.TargetFrameworks.Any(tf => tf.Dependencies.Any(library => IsMatchingDependencyName(library, packageId)))) 269var existingDependency = list.Any(dep => IsMatchingDependencyName(dep, packageId));
Roslyn.Diagnostics.Analyzers (25)
IRemoteJsonServiceParameterAnalyzer.cs (1)
65!namedTypeSymbol.AllInterfaces.Any(i => Equals(i, remoteJsonService)))
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (2)
1213/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Any{T}(ImmutableArray{T}, Func{T, bool})"/>. 1258=> array.Any(predicate);
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
180=> HasOneItem ? predicate(_one) : _many.Any(predicate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
392|| namedType.GetAttributes().Any((a) =>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (3)
326return methodSymbol.Parameters.Any(p => p.IsOptional); 377return method.ContainingType.AllInterfaces.Any(i => iCollectionTypes.Contains(i.OriginalDefinition)); 520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
58if (type.OriginalDefinition.AllInterfaces.Any(baseInterface => baseInterface.OriginalDefinition.Equals(parentType)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
113descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 180descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable)) 224descriptor.ImmutableCustomTags().Any(static tag => tag is WellKnownDiagnosticTags.Compiler or WellKnownDiagnosticTags.NotConfigurable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
195if (x.SymbolSpecification.RequiredModifierList.Any(static x => x.ModifierKindWrapper == SymbolSpecification.ModifierKindEnum.IsConst))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (2)
19=> first.Any(predicate) || second.Any(predicate);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (2)
847if (symbol.GetAttributes().Any(static x => x.AttributeClass is 854if (!symbol.GetAttributes().Any(static x => x.AttributeClass is
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
63return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
409typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 801namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (1)
64if (linkedDocuments.Any(id => documentToLinkedDocuments.ContainsKey(id)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
503modifiers: DeclarationModifiers.None.WithIsUnsafe(!isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
71else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 91=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
Roslyn.Diagnostics.CSharp.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
78if (leadingDirectives.Any(t => t.Kind() == SyntaxKind.EndIfDirectiveTrivia))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
535return symbolInfo.GetBestOrAllSymbols().Any() && !symbolInfo.GetBestOrAllSymbols().Any(static s => s is IMethodSymbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1038var anyGeneric = symbols.Any(static s =>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
639if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 758var maxParameterCount = parameterList.Any(p => p.IsParams) ? int.MaxValue : parameterList.Length; 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate))
System.Text.Json.SourceGeneration (5)
Helpers\RoslynExtensions.cs (2)
120=> attributeType != null && memberInfo.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, attributeType)); 379return symbol.GetAttributes().Any(attr =>
JsonSourceGenerator.Parser.cs (3)
1351type.AllInterfaces.Any(i => 2398!namedConverterType.Constructors.Any(c => c.Parameters.Length == 0 && IsSymbolAccessibleWithin(c, within: contextType))) 2419!namedClassifierType.Constructors.Any(c => c.Parameters.Length == 0 && IsSymbolAccessibleWithin(c, within: contextType)))
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
69if (generatedRegexAttr.ConstructorArguments.Any(ca => ca.Kind == TypedConstantKind.Error))
System.Windows.Forms.Analyzers.CSharp (4)
System\Windows\Forms\CSharp\Analyzers\ImplementITypedDataObject\ImplementITypedDataObjectAnalyzer.cs (2)
53.Any(i => i.Name == "ITypedDataObject" && i.ContainingNamespace.ToDisplayString() == Namespace); 60.Any(i => i.Name == "IDataObject" && i.ContainingNamespace.ToDisplayString() == Namespace);
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (2)
52.Any(i => i.Name == nameof(IComponent) && 75.Any(a => a?.AttributeClass?.Name is (nameof(DesignerSerializationVisibilityAttribute))
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
226bool isFlags = enumType.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttributeType));