396 references to Any
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
273if (analyzer.SupportedDiagnostics.Any(static diagnosticDescriptor => diagnosticDescriptor.IsEnabledByDefault))
BuildActionTelemetryTable (4)
src\Workspaces\Core\Portable\Shared\Extensions\TelemetryExtensions.cs (1)
56if (diagnostic.Descriptor.ImmutableCustomTags().Any(static t => t == WellKnownDiagnosticTags.Telemetry))
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))
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);
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.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
86diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
DiagnosticVerifier.cs (1)
109diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (1)
269if (!(method.ReducedFrom ?? method).Parameters.Any(
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
118var implementsIParsable = typeSymbol.AllInterfaces.Any(
Microsoft.AspNetCore.Components.Analyzers (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.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.AspNetCore.Http.RequestDelegateGenerator (18)
RequestDelegateGenerator.cs (15)
174var hasJsonBodyOrService = endpoints.Any(endpoint => endpoint.EmitterContext.HasJsonBodyOrService); 175var hasJsonBodyOrQuery = endpoints.Any(endpoint => endpoint.EmitterContext.HasJsonBodyOrQuery); 176var hasJsonBody = endpoints.Any(endpoint => endpoint.EmitterContext.HasJsonBody); 177var hasFormBody = endpoints.Any(endpoint => endpoint.EmitterContext.HasFormBody); 178var hasRouteOrQuery = endpoints.Any(endpoint => endpoint.EmitterContext.HasRouteOrQuery); 179var hasBindAsync = endpoints.Any(endpoint => endpoint.EmitterContext.HasBindAsync); 180var hasParsable = endpoints.Any(endpoint => endpoint.EmitterContext.HasParsable); 181var hasEndpointMetadataProvider = endpoints.Any(endpoint => endpoint.EmitterContext.HasEndpointMetadataProvider); 182var hasEndpointParameterMetadataProvider = endpoints.Any(endpoint => endpoint.EmitterContext.HasEndpointParameterMetadataProvider); 183var hasIResult = endpoints.Any(endpoint => endpoint.Response?.IsIResult == true); 240var hasFormBody = endpoints.Any(endpoint => endpoint.EmitterContext.HasFormBody); 241var hasJsonBody = endpoints.Any(endpoint => endpoint.EmitterContext.HasJsonBody || endpoint.EmitterContext.HasJsonBodyOrService || endpoint.EmitterContext.HasJsonBodyOrQuery); 242var hasResponseMetadata = endpoints.Any(endpoint => endpoint.EmitterContext.HasResponseMetadata); 243var requiresPropertyAsParameterInfo = endpoints.Any(endpoint => endpoint.EmitterContext.RequiresPropertyAsParameterInfo); 244var requiresParameterBindingMetadataClass = endpoints.Any(endpoint => endpoint.EmitterContext.RequiresParameterBindingMetadataClass);
src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
118var implementsIParsable = typeSymbol.AllInterfaces.Any(
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (2)
35((INamedTypeSymbol)typeSymbol).TypeArguments.Any(a => a is ITypeParameterSymbol)) 42((INamedTypeSymbol)typeSymbol).TypeArguments.Any(typeArg =>
Microsoft.CodeAnalysis (16)
CodeGen\PermissionSetAttribute.cs (1)
85Debug.Assert(((INamedTypeSymbol)iSymbol).GetMembers(HexPropertyName).Any(
CommandLine\CommonCompiler.cs (1)
1126if (HasSuppressableWarningsOrErrors(diagnostics) && analyzers.Any(a => a is DiagnosticSuppressor))
Compilation\Compilation.cs (1)
253if (previousScriptCompilation.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
380HasDiagnosticSuppressors = this.Analyzers.Any(static a => a is DiagnosticSuppressor);
DiagnosticAnalyzer\AnalyzerImageReference.cs (1)
26if (analyzers.Any(static a => a == null))
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
140if (analyzers.Any(static a => a == null)) 775if (compilationEvents.Any(e => e is SymbolDeclaredCompilationEvent) &&
InternalUtilities\OneOrMany.cs (1)
179=> HasOneItem ? predicate(_one) : _many.Any(predicate);
MetadataReader\MetadataDecoder.cs (1)
40return !modifiers.IsDefaultOrEmpty && modifiers.Any(static m => !m.IsOptional);
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)
4177if (!locals.Any(static variable => !variable.SlotInfo.Id.IsNone)) 4187if (!locals.Any(static variable => !variable.SlotInfo.Id.IsNone))
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.CodeStyle (16)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
142var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 160collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
83=> operation.Arms.Any(IsDefault);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
908methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
433method.Parameters.Any(static p => p.IsRefOrOut() && p.Type.IsDelegateType())))
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
169if (members.Any(m => m is IMethodSymbol))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
197return addMethods.Any(static m => m is IMethodSymbol methodSymbol && methodSymbol.Parameters.Any());
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
179=> HasOneItem ? predicate(_one) : _many.Any(predicate);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
806=> symbol.GetAttributes().Any(static x => x.AttributeClass is
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
61return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
406typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
354if (GetParameterTypes(cancellationToken).Any(static t => !IsValidAttributeParameterType(t)))
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
94if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared))
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
52return locations.Any(static loc => loc.IsInSource);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
66=> fields.Any(f => IsAssignedToField(f, parameter)) || properties.Any(p => IsAssignedToProperty(p, parameter));
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
83var isComImport = unimplementedMembers.Any(static t => t.type.IsComImport); 270return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 279var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
89if (lastCase.Clauses.Any(static c => c.CaseKind == CaseKind.Default))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
70else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 92=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
148ITupleOperation tupleOperation => tupleOperation.Elements.Any(IsSymbolReferencedByOperation),
Microsoft.CodeAnalysis.CSharp (79)
Binder\Binder_Attributes.cs (1)
250if (attributeConstructor.Parameters.Any(static p => p.RefKind is RefKind.In or RefKind.RefReadOnlyParameter))
Binder\Binder_Expressions.cs (4)
5917if (handlerPlaceholders.Any(static placeholder => placeholder.ArgumentIndex == BoundInterpolatedStringArgumentPlaceholder.InstanceParameter)) 10805(parameters.Any(p => p.EffectiveScope != ScopedKind.None) ? parameters.SelectAsArray(p => p.EffectiveScope) : default); 10807(parameters.Any(p => p.HasUnscopedRefAttribute && p.UseUpdatedEscapeRules) ? parameters.SelectAsArray(p => p.HasUnscopedRefAttribute && p.UseUpdatedEscapeRules) : default); 10808var parameterDefaultValues = parameters.Any(p => p.HasExplicitDefaultValue) ?
Binder\Binder_InterpolatedString.cs (1)
323parts.Any(static p => p.HasErrors ||
Binder\Binder_Invocation.cs (1)
129Debug.Assert(!args.Any(static e => e.Kind == BoundKind.OutVariablePendingInference ||
Binder\Semantics\Conversions\Conversions.cs (1)
95if (invoke.Parameters.Any(p => p.HasUnscopedRefAttribute))
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
416if (u.Any(isValid)) 470if (u.Any(isValid))
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
2992return constraintTypes.Any(static t => isExpressionType(t.Type));
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
2598return conversionsOpt.Any(static c => c.Kind == ConversionKind.FunctionType);
BoundTree\BoundDecisionDag.cs (1)
205return this.TopologicallySortedNodes.Any(static node => node is BoundEvaluationDecisionDagNode e && e.Evaluation.Kind == BoundKind.DagAssignmentEvaluation);
BoundTree\UnboundLambda.cs (1)
409bool hasErrors = !types.IsDefault && types.Any(static t => t.Type?.Kind == SymbolKind.ErrorType);
Compilation\CSharpCompilation.cs (1)
4203if (!memberIsReadOnly.IsDefault && memberIsReadOnly.Any(static v => !v))
Emitter\Model\GenericTypeInstanceReference.cs (1)
30Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (1)
29Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any()));
FlowAnalysis\DefiniteAssignment.cs (1)
403var foundAwait = result.Any(static pending => HasAwait(pending));
FlowAnalysis\NullableWalker.cs (6)
1615return compilation.SyntaxTrees.Any(static tree => ((CSharpSyntaxTree)tree).IsNullableAnalysisEnabled(new Text.TextSpan(0, tree.Length)) == true); 3649return AnonymousTypeManager.GetAnonymousTypeFieldTypes(type).Any(static t => canIgnoreAnyType(t.Type)); 4507if (members.Any(static m => m.Kind == SymbolKind.Field)) 4513if (members.Any(static m => m.Kind == SymbolKind.Property)) 6848Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection)); 6908bool 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.IsSourceParameterWithEnumeratorCancellationAttribute()))
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
250=> variableType.GetMembers(WellKnownMemberNames.ObjectToString).Any(m => m.GetOverriddenMember() is not null);
Lowering\LocalRewriter\LocalRewriter.cs (7)
334delegateInvoke.Parameters.Any(static (p) => p.IsParamsCollection)) 390if (typeParameters.Any(static typeParameter => typeParameter.HasUnmanagedTypeConstraint)) 398typeParameters.Any(static t => t.ConstraintTypesNoUseSiteDiagnostics.Any(static t => t.ContainsNativeIntegerWrapperType()))) 406bool constraintsNeedNullableAttribute = typeParameters.Any( 416predicate(localFunction.ReturnTypeWithAnnotations) || localFunction.ParameterTypesWithAnnotations.Any(predicate); 1128symbol.Parameters.Any(static p => p.RefKind == RefKind.In))
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
972if (!sortedNodes.Any(static n => n.Kind == BoundKind.WhenDecisionDagNode)) return;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (3)
516.Any(static node => node is BoundWhenDecisionDagNode { WhenExpression: { ConstantValueOpt: null } }); 556!decisionDag.TopologicallySortedNodes.Any(static n => usesOriginalInput(n))) 583return n.Bindings.Any(static b => b.TempContainingValue.IsOriginalInput);
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
673(requiresInstanceReceiver && arguments.Any(a => usesReceiver(a))))
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
746delegateInvoke.Parameters.Any(static (p) => p.IsParamsCollection))
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
408Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection));
Lowering\SyntheticBoundNodeFactory.cs (1)
1736var discardsPresent = arguments.Any(static a => a.Kind == BoundKind.DiscardExpression);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
523return modifiers.Any(static m => !m.IsEmpty);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
259if (fields.Any(static f => f.RefKind != RefKind.None))
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
790parameter.RefCustomModifiers.Any(static m => !m.IsOptional))
Symbols\MemberSymbolExtensions.cs (1)
581return method.ReturnType.ContainsTupleNames() || method.Parameters.Any(static p => p.Type.ContainsTupleNames());
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
329_packedFlags.SetIsVolatile(customModifiersArray.Any(static m => !m.IsOptional && ((CSharpCustomModifier)m).ModifierSymbol.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile));
Symbols\MethodSymbol.cs (1)
869if (typeArguments.Any(NamedTypeSymbol.TypeWithAnnotationsIsNullFunction))
Symbols\NamedTypeSymbol.cs (1)
1201if (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)
1960bool emitCompilationRelaxationsAttribute = !isBuildingNetModule && !this.Modules.Any(static m => m.HasAssemblyCompilationRelaxationsAttribute); 1980bool emitRuntimeCompatibilityAttribute = !isBuildingNetModule && !this.Modules.Any(static m => m.HasAssemblyRuntimeCompatibilityAttribute);
Symbols\Source\SourceMemberContainerSymbol.cs (10)
231Debug.Assert(containingSymbol is NamespaceSymbol { IsGlobalNamespace: true } || !declaration.Declarations.Any(static d => d.IsSimpleProgram)); 1070Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol)); 1071Debug.Assert(haveIndexers == nonTypeMembers.Any(static s => s.IsIndexer())); 1406hasDeclaredMembers = declaration.Declarations.Any(static decl => decl.HasRequiredMembers); 1850if (interfaces.Any(needsTupleElementNamesAttribute)) 1897interfaces.Any(predicate); 2258Debug.Assert(!membersByName[indexerName.AsMemory()].Any(SymbolExtensions.IsIndexer)); 2981Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol)); 4874return initializers.Any(static siblings => siblings.Any(static initializer => !initializer.FieldOpt.IsConst));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
1395else if (parameters.Any(p => (p.RefKind is RefKind.Ref or RefKind.Out) && p.Type.IsRefLikeOrAllowsRefLikeType())) 1411else if (parameters.Any(p => p.RefKind == RefKind.None && p.Type.IsRefLikeOrAllowsRefLikeType()))
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1181var foundAnyMatch = interceptorsNamespaces.Any(ns => isDeclaredInNamespace(thisNamespaceNames, ns));
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1811return this.declaration.Declarations.Any(static d => d.IsSimpleProgram); 1958|| !InstanceConstructors.Any(c => c is { ParameterCount: 0, DeclaredAccessibility: Accessibility.Internal or Accessibility.Public })
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
819else if (IsPartial && !HasExplicitAccessModifier && Parameters.Any(static p => p.RefKind == RefKind.Out))
Symbols\Source\SourceTypeParameterSymbol.cs (2)
306&& ConstraintTypesNoUseSiteDiagnostics.Any(static t => t.ContainsNativeIntegerWrapperType())) 330if (this.ConstraintTypesNoUseSiteDiagnostics.Any(static c => c.NeedsNullableAttribute()))
Symbols\Symbol_Attributes.cs (1)
377Debug.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\TypeMap.cs (1)
46Debug.Assert(allowAlpha || !from.Any(static tp => tp is SubstitutedTypeParameterSymbol));
Symbols\VarianceSafety.cs (2)
91Debug.Assert(container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None)); 108if (container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None))
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
275if (type.AllInterfaces.Any(t => t.OriginalDefinition.Equals(isetType) || t.OriginalDefinition.Equals(ireadOnlySetType)))
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
75firstParameter.Type.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType)))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out)) 369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
65if (leadingDirectives.Any(t => t.Kind() == SyntaxKind.EndIfDirectiveTrivia))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
299if (positionalParameterInfos.Any(info => info.IsInherited))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
635if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 754var maxParameterCount = parameterList.Any(p => p.IsParams) ? int.MaxValue : parameterList.Length;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Semantics\SpeculationAnalyzerTests.cs (2)
540return !langCompilation.GetDiagnostics().Any(isProblem) && 541!langCompilation.Emit(temporaryStream).Diagnostics.Any(isProblem);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
FlowAnalysis\IterationJumpYieldStatementTests.cs (2)
917Assert.True(flow.VariablesDeclared.Any((s) => s.Name == "b")); 918Assert.True(flow.VariablesDeclared.Any((s) => s.Name == "s"));
Semantics\PatternMatchingTests_ListPatterns.cs (1)
3453Assert.True(used.Any(r => r.Display == "range"));
Microsoft.CodeAnalysis.CSharp.Features (15)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
605if (!fixAllSpans.Any(fixAllSpan => fixAllSpan.Contains(originalNode.Span)))
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
199=> namespaceSymbol != null && namespaceSymbol.GetTypeMembers(name).Any(static t => t.DeclaredAccessibility == Accessibility.Public);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
190if (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 (1)
214var preselect = symbols.Any(static t => t.Preselect);
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))
ExtractMethod\CSharpSelectionResult.cs (1)
134=> exitPoints.Any(n => n is not (BreakStatementSyntax or ContinueStatementSyntax or ReturnStatementSyntax));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (2)
61semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static s => s is not INamedTypeSymbol) || 62(throughSymbol is not INamespaceOrTypeSymbol && semanticModel.LookupSymbols(throughExpression.SpanStart, container: throughSymbol?.ContainingType).Any(static s => s is not INamedTypeSymbol));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
275if (type.AllInterfaces.Any(t => t.OriginalDefinition.Equals(isetType) || t.OriginalDefinition.Equals(ireadOnlySetType)))
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
75firstParameter.Type.AllInterfaces.Any(i => Equals(i.OriginalDefinition, ienumerableOfTType)))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out)) 369if (constructor.Parameters.Any(p => p.Type.IsRefLikeType))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
299if (positionalParameterInfos.Any(info => info.IsInherited))
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
154Assert.False(m.ReferencedAssemblies.Any(a => a.Name == "libB"));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\LookupTests.cs (1)
1986Assert.True(symbols.Any(s => s.Kind == SymbolKind.TypeParameter));
Semantics\ScriptSemanticsTests.cs (1)
606Assert.False(symbols.Any(s => s.Name == "Roslyn"));
Semantics\TopLevelStatementsTests.cs (4)
3952Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4101Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4136Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter)); 4141Assert.False(symbols.Any(s => s.Kind == SymbolKind.Parameter));
Semantics\UnsafeTests.cs (1)
5190if (expectError != compilationDiagnostics.Any(diag => diag.Severity == DiagnosticSeverity.Error))
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (2)
225Assert.False(step.Outputs.Any(o => o.Value is ClassDeclarationSyntax { Identifier.ValueText: "D" })); 256Assert.False(step.Outputs.Any(o => o.Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (30)
Compilation\GetImportScopesTests.cs (20)
147Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 148Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) })); 149Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 150Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 336Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } })); 337Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 338Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 339Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 536Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 537Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE2", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 538Assert.True(scopes.Single().ExternAliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE1" })); 539Assert.True(scopes.Single().ExternAliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE2" })); 682Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 683Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 684Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.IO) })); 685Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.IO) } } })); 688Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 689Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 690Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "T", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.Threading) } })); 691Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.Threading) } } }));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (9)
1388Assert.True(symbolsInC.Any(s => s.Name == "A" && s.Kind == SymbolKind.NamedType)); 1389Assert.True(symbolsInC.Any(s => s.Name == "B" && s.Kind == SymbolKind.NamedType)); 1390Assert.True(symbolsInC.Any(s => s.Name == "C" && s.Kind == SymbolKind.NamedType)); 1391Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "A")); 1392Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "B")); 1393Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1394Assert.True(symbolsInC.Any(s => s.Name == "F" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1395Assert.True(symbolsInC.Any(s => s.Name == "System" && s.Kind == SymbolKind.Namespace)); 1396Assert.True(symbolsInC.Any(s => s.Name == "Microsoft" && s.Kind == SymbolKind.Namespace));
Compilation\UsedAssembliesTests.cs (1)
282Assert.True(diagnostics.Any(d => d.DefaultSeverity == DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CSharpTestBase.cs (1)
1379if (!compileDiagnostics.Any(d => d.DefaultSeverity == DiagnosticSeverity.Error) &&
Extensions.cs (1)
191return type.InstanceConstructors.Single(c => c.DeclaringSyntaxReferences.Any(r => r.GetSyntax() is TypeDeclarationSyntax));
UsesIsNullableVisitor.cs (1)
213return types.Any(t => UsesIsNullable(t, inProgress));
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
227return scopes.Any(static s => s.Aliases.Length > 0); 409return symbols.Any(static s => s is ILocalSymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
65if (leadingDirectives.Any(t => t.Kind() == SyntaxKind.EndIfDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1030var anyGeneric = symbols.Any(static s =>
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
635if (method.TypeArguments.Any(static t => t.Kind == SymbolKind.ErrorType)) 754var maxParameterCount = parameterList.Any(p => p.IsParams) ? int.MaxValue : parameterList.Length;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractArgumentProviderTests`1.cs (1)
116=> parameters.Any(parameter => parameter.IsParams) ? int.MaxValue : parameters.Length;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
SymbolFinder\DependentTypeFinderTests.cs (4)
583Assert.True(delegates.Any(i => i.Locations.Any(loc => loc.IsInMetadata)), "We should find a metadata delegate"); 584Assert.Single(delegates, i => i.Locations.Any(loc => loc.IsInSource)); // We should find a single source delegate 613Assert.True(enums.Any(i => i.Locations.Any(loc => loc.IsInMetadata)), "We should find a metadata enum"); 614Assert.Single(enums, i => i.Locations.Any(loc => loc.IsInSource)); // We should find a single source type
Microsoft.CodeAnalysis.Features (37)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
114!constructorParams.Any(static p => p.IsParams) &&
ChangeSignature\AbstractChangeSignatureService.cs (1)
149if (symbol.Locations.Any(static loc => loc.IsInMetadata))
CodeLens\CodeLensFindReferenceProgress.cs (1)
127!definition.Locations.Any(static loc => loc.IsInSource);
CodeRefactorings\MoveType\AbstractMoveTypeService.State.cs (1)
59typeSymbol.Locations.Any(static loc => loc.IsInMetadata) ||
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
124return namedType.GetTypeMembers().Any(IsValidForGenericConstraintContext);
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
228var preselect = symbols.Any(static t => t.Preselect);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
154=> aliases.IsEmpty || aliases.Any(static alias => alias == MetadataReferenceProperties.GlobalAlias);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
239if (!fixAllSpans.Any(fixAllSpan => fixAllSpan.Contains(originalIfStatement.Span)))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
135if (!capturedTypeParameters.Any(static tp => tp.TypeParameterKind == TypeParameterKind.Method)) 144if (!capturedTypeParameters.Any(static tp => tp.TypeParameterKind == TypeParameterKind.Type))
Debugging\AbstractBreakpointResolver.cs (1)
269if ((methodOrProperty.Language == _language) && methodOrProperty.Locations.Any(static location => location.IsInSource))
EditAndContinue\RudeEditDiagnostic.cs (1)
60=> diagnostics.Any(IsBlockingRudeEdit);
EditAndContinue\Utilities\Extensions.cs (1)
173=> !type.InstanceConstructors.Any(static c => !(c.Parameters is [] || c.ContainingType.IsRecord && c.IsCopyConstructor()));
FindUsages\DefinitionItemFactory.cs (2)
167if (!definition.Locations.Any(static location => location.MetadataModule != null)) 196if (!constituentNamespace.Locations.Any(static location => location.MetadataModule != null))
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (2)
62if (mappedMembers.Any(m => m is null)) 107where c.Parameters.All(p => p.RefKind == RefKind.None) && !c.Parameters.Any(static p => p.IsParams)
GenerateType\AbstractGenerateTypeService.State.cs (1)
298!symbol.Locations.Any(static loc => loc.IsInSource))
GoToBase\AbstractGoToBaseService.cs (1)
74else if (baseSymbol.Locations.Any(static l => l.IsInMetadata))
MetadataAsSource\MetadataAsSourceFileService.cs (1)
281if (!symbol.Locations.Any(static l => l.IsInMetadata))
ReplaceMethodWithProperty\AbstractReplaceMethodWithPropertyService.cs (1)
35if (current.Locations.Any(static loc => loc.IsInMetadata))
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
142var isFixable = collectionType.SpecialType == SpecialType.System_Collections_IEnumerable || collectionType.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 160collectionType.AllInterfaces.Any(static i => i.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
83=> operation.Arms.Any(IsDefault);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
908methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
169if (members.Any(m => m is IMethodSymbol))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
197return addMethods.Any(static m => m is IMethodSymbol methodSymbol && methodSymbol.Parameters.Any());
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
354if (GetParameterTypes(cancellationToken).Any(static t => !IsValidAttributeParameterType(t)))
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
94if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared))
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
52return locations.Any(static loc => loc.IsInSource);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
66=> fields.Any(f => IsAssignedToField(f, parameter)) || properties.Any(p => IsAssignedToProperty(p, parameter));
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
83var isComImport = unimplementedMembers.Any(static t => t.type.IsComImport); 270return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 279var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
89if (lastCase.Clauses.Any(static c => c.CaseKind == CaseKind.Default))
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
144var includeFirstLineInDiagnostics = expectedResult.Diagnostics.Any(d => d.FirstLine != null) == true; 195Assert.Equal(expectedResult.Diagnostics.Any(d => d.RudeEditKind.IsBlocking()), result.ExceptionRegions.IsDefault);
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.Service.cs (1)
669if (diagnostics.Any(static d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\ProjectDependencyHelper.cs (1)
88var projectAssetsHasVersion = projectAssetsVersions.Any(projectAssetsVersion => SatisfiesVersion(requestedVersionRange, projectAssetsVersion));
Microsoft.CodeAnalysis.Rebuild (1)
CompilationOptionsReader.cs (1)
444public bool HasEmbeddedPdb => PeReader.ReadDebugDirectory().Any(static entry => entry.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (2)
197if (!UnblameableMethodPrefixes.Any(p => blamedMethod.StartsWith(p))) 213if (!UnblameableMethodPrefixes.Any(p => methodName.StartsWith(p)))
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
ScriptingTestHelpers.cs (1)
91e.Diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error && e.Message == d.ToString());
Microsoft.CodeAnalysis.Test.Utilities (1)
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
83if (frameworkReferences.Any(x => x.GetModuleVersionId() == info.Mvid))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (14)
Compilation\GetImportScopesTests.vb (12)
123Assert.True(scopes.Single().Imports.Any(Function(i) IsNamespaceWithName(i.NamespaceOrType, NameOf(System)))) 124Assert.True(scopes.Single().Imports.Any(Function(i) IsNamespaceWithName(i.NamespaceOrType, NameOf(Microsoft)))) 126Assert.True(scopes.Single().Imports.Any(Function(i) IsSimpleImportsClauseWithName(i.DeclaringSyntaxReference, NameOf(System)))) 127Assert.True(scopes.Single().Imports.Any(Function(i) IsSimpleImportsClauseWithName(i.DeclaringSyntaxReference, NameOf(Microsoft)))) 276Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasWithName(a, "S", NameOf(System), inGlobalNamespace:=True))) 277Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasImportsClauseWithName(a, "S"))) 278Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasWithName(a, "M", NameOf(Microsoft), inGlobalNamespace:=True))) 279Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasImportsClauseWithName(a, "M"))) 409Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.XmlNamespace = "http://roslyn")) 411Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.DeclaringSyntaxReference.GetSyntax().ToString() = "<xmlns:r1=""http://roslyn"">")) 413Assert.True(scopes.Single().XmlNamespaces.Any(Function(X) X.XmlNamespace = "http://roslyn2")) 415Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.DeclaringSyntaxReference.GetSyntax().ToString() = "<xmlns:r2=""http://roslyn2"">"))
FlowAnalysis\IterationJumpYieldStatementTests.vb (2)
1348Assert.Equal(True, flow.VariablesDeclared.Any(Function(s) s.Name = "b")) 1349Assert.Equal(True, flow.VariablesDeclared.Any(Function(s) s.Name = "s"))
Microsoft.CodeAnalysis.Workspaces (34)
CodeFixes\CodeFixContext.cs (1)
245if (diagnostics.Any(static d => d == null))
Diagnostics\DiagnosticAnalyzerInfoCache.cs (1)
185descriptors.Length > 0 && descriptors[0].ImmutableCustomTags().Any(static t => t == WellKnownDiagnosticTags.Telemetry);
Editing\SyntaxGenerator.cs (1)
243method.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)) 120var project = assembly.Locations.Any(static loc => loc.IsInMetadata)
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
73var searchInMetadata = type.Locations.Any(s_isInMetadata); 363derivedType.Locations.Any(s_isInMetadata) &&
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
227var 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)
235c => c.DeclaringSyntaxReferences.Any(r => linkedNode.Equals(r.GetSyntax(cancellationToken))));
FindSymbols\SymbolFinder_Helpers.cs (1)
18if (symbol.Locations.Any(static l => l.IsInMetadata))
Recommendations\AbstractRecommendationServiceRunner.cs (1)
136if (!parameterTypeSymbols.Any(static t => t.IsKind(SymbolKind.TypeParameter)))
Rename\ConflictEngine\ConflictResolver.cs (1)
172return conflictResolution.ReplacementTextValid && renamedSymbol != null && renamedSymbol.Locations.Any(static loc => loc.IsInSource);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
68referencedSymbol.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)
659(s.IsNamespace() || s.Locations.Any(static loc => loc.IsInSource) || !s.HasUnsupportedMetadata) &&
Shared\Extensions\ITypeSymbolExtensions.cs (2)
158typeSymbol.Locations.Any(static location => location.IsInSource)) || 183return type.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))
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
179=> HasOneItem ? predicate(_one) : _many.Any(predicate);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
806=> symbol.GetAttributes().Any(static x => x.AttributeClass is
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
61return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
406typeSymbol.AllInterfaces.Any(static i => i.SpecialType == SpecialType.System_Collections_IEnumerable) && 764namedType.OriginalDefinition.GetAttributes().Any(static a => a.AttributeClass?.SpecialType == SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
483modifiers: new DeclarationModifiers(isUnsafe: !isContainedInUnsafeType && parameters.Any(static p => p.RequiresUnsafeModifier())),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
70else if (!symbol.Locations.Any(static loc => loc.IsInMetadata)) 92=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
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)))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
179=> HasOneItem ? predicate(_one) : _many.Any(predicate);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Remote\ServiceDescriptorTests.cs (1)
324if (!MessagePackFormatters.Formatters.Any(
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
688.Any(ds => ds.GetSyntax() is ClassDeclarationSyntax));
Microsoft.Extensions.Options.SourceGeneration (1)
ParserUtilities.cs (1)
36.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.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 (13)
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\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)
126mayRequireAdditionalWork |= 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)));
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
245&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 254&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 275&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute))
VtableIndexStubGenerator.cs (2)
294bool implementsIUnmanagedInterfaceOfSelf = symbol.ContainingType.AllInterfaces.Any(iface => SymbolEqualityComparer.Default.Equals(iface, expectedUnmanagedInterfaceType)); 419if (!method.ContainingType.GetAttributes().Any(att => att.AttributeClass.IsOfType(TypeNames.UnmanagedObjectUnwrapperAttribute)))
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
172mayRequireAdditionalWork |= bindingFailures.Any(d => d.IsFatal);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
245&& !parameter.GetAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 254&& !methodSymbol.GetReturnTypeAttributes().Any(attr => attr.AttributeClass?.ToDisplayString() == TypeNames.System_Runtime_InteropServices_MarshalAsAttribute)) 275&& !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.SourceModule.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 => Equals(a.AttributeClass, wantsToBeBestFriendsAttributeType)); 104if (symbol.GetAttributes().Any(a => Equals(a.AttributeClass, bestFriendAttributeType)))
InstanceInitializerAnalyzer.cs (1)
49if (symbol.GetAttributes().Any(i => i.AttributeClass.Name == "ArgumentAttribute"))
Microsoft.VisualStudio.LanguageServices (13)
CommonControls\MemberSelectionViewModel.cs (1)
49public bool ShowMakeAbstract => _members.Any(m => m.IsMakeAbstractCheckable);
DocumentOutline\DocumentOutlineViewModel_Utilities.cs (1)
230return patternMatcher.Matches(tree.Name) || tree.Children.Any(c => SearchNodeTree(c, patternMatcher, cancellationToken));
ExtractInterface\ExtractInterfaceDialogViewModel.cs (1)
63if (!MemberContainers.Any(c => c.IsChecked))
InheritanceMargin\MarginGlyph\InheritanceMarginGlyph.cs (1)
177&& inheritanceMarginViewModel.MenuItemViewModels.Any(static vm => vm is TargetMenuItemViewModel))
Library\ObjectBrowser\AbstractListItemFactory.cs (5)
134|| symbol.Locations.Any(static l => l.IsInSource || l.IsInMetadata); 149if (symbol.Locations.Any(static l => l.IsInSource)) 154if (symbol.Locations.Any(static l => l.IsInMetadata)) 571if (typeMember.Locations.Any(static l => l.IsInSource)) 576if (typeMember.Locations.Any(static l => l.IsInMetadata))
Progression\GraphBuilder.cs (1)
211if (preferredLocation == null && symbol.Locations.Any(static loc => loc.IsInMetadata))
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
360return (assembly, storageHandles.Any(h => h is null) ? null : storageHandles);
Watson\FaultReporter.cs (2)
197if (!UnblameableMethodPrefixes.Any(p => blamedMethod.StartsWith(p))) 213if (!UnblameableMethodPrefixes.Any(p => methodName.StartsWith(p)))
System.Text.Json.SourceGeneration (3)
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 (1)
1581!namedConverterType.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 (2)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (2)
35.Any(i => i.Name == nameof(IComponent))) 49.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));
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
309Assert.False(diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error), $"Failed: {diagnostics.FirstOrDefault()?.GetMessage()}");