778 references to Contains
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
234language => refactorings.Where(refactoring => refactoring.Metadata.Languages.Contains(language)).ToImmutableArray());
Aspire.Dashboard.Tests (1)
Integration\ResponseCompressionTests.cs (1)
53Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Aspire.Hosting (3)
ApplicationModel\CommandsConfigurationExtensions.cs (1)
117static bool IsStopped(string? state) => KnownResourceStates.TerminalStates.Contains(state) || state == KnownResourceStates.NotStarted || state == "Unknown";
ApplicationModel\ResourceNotificationService.cs (1)
354KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) ||
Health\ResourceHealthCheckService.cs (1)
73else if (KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text))
Aspire.Hosting.Azure (1)
AzurePublishingContext.cs (1)
329else if (resource is IResourceWithParameters rwp && !bicepResourcesToPublish.Contains(resource))
Aspire.Hosting.Containers.Tests (1)
DockerSocketBindMountTests.cs (1)
42e => KnownResourceStates.TerminalStates.Contains(e.Snapshot.State?.Text),
Aspire.Hosting.Tests (1)
Dcp\TestKubernetesService.cs (1)
40if (DeletedResources.Contains(name))
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
288return !_typeMap.Values.Contains(node.Name);
CodeGenerator (5)
src\Servers\Kestrel\shared\KnownHeaders.cs (5)
181ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 252ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 279ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@"
CodeStyleConfigFileGenerator (4)
Program.cs (4)
168isEnabledInNonDefaultMode = !rule.CustomTags.Contains(s_neverTag); 173isEnabledInNonDefaultMode = rule.CustomTags.Contains(s_highlyRecommendedTag); 178isEnabledInNonDefaultMode = rule.CustomTags.Contains(s_highlyRecommendedTag) || rule.CustomTags.Contains(s_recommendedTag);
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
488var packages = attributes.Where(a => a.CodeGenerators.Contains(generator));
dotnet-svcutil-lib (8)
CmdCredentialsProvider.cs (2)
154if (!_validatedClientCerts.Keys.Contains(certhash)) 225if (!_validatedServerCerts.Keys.Contains(certhash))
CommandProcessorOptions.cs (1)
632if (!references.Contains(this.References[idx]))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (1)
485if (Enumerable.Contains(s_knownSerializableTypeNames, type.FullName))
Shared\MSBuildProj.cs (3)
970if (!propertyNames.All(p => this._resolvedProperties.Keys.Contains(p))) 972var propertyTable = this._resolvedProperties.Where(p => propertyNames.Contains(p.Key)); 985return this._resolvedProperties.Where(p => propertyNames.Contains(p.Key));
Shared\ProjectPropertyResolver.cs (1)
246if (string.IsNullOrWhiteSpace(propertyName) || propertyName.Any(c => chars.Contains(c) || !char.IsLetterOrDigit(c)))
GenerateDocumentationAndConfigFiles (25)
Program.cs (3)
1301return !rule.CustomTags.Contains(customTag); 1305return rule.CustomTags.Contains(customTag); 1497isEnabledRuleForNonDefaultAnalysisMode = rule.CustomTags.Contains(WellKnownDiagnosticTagsExtensions.EnabledRuleInAggressiveMode);
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
267if (!documentNames.Contains(_context.DocumentName))
http2cat (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
IIS.LongTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
ILLink.CodeFixProvider (2)
DynamicallyAccessedMembersCodeFixProvider.cs (2)
114addAsReturnAttribute: AttributeOnReturn.Contains(diagnostic.Id), 115addGenericParameterAttribute: AttributeOnGeneric.Contains(diagnostic.Id),
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
57else if (TestProperties.PropertyNames.Contains(conditionName))
installer.tasks (2)
GenerateTestSharedFrameworkDepsFile.cs (1)
122if (ridFallback.Contains(runtime))
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
171.Where(r => r.Content?.Sections.Contains(s) == true)
Metrics (22)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Metrics.Legacy (22)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.AspNetCore.Antiforgery.Test (7)
DefaultAntiforgeryTest.cs (7)
386.Contains(ResponseCacheHeadersOverrideWarningMessage); 404.Contains(ResponseCacheHeadersOverrideWarningMessage); 422.Contains(ResponseCacheHeadersOverrideWarningMessage); 440.Contains(ResponseCacheHeadersOverrideWarningMessage); 1302.Contains(ResponseCacheHeadersOverrideWarningMessage); 1341.Contains(ResponseCacheHeadersOverrideWarningMessage); 1375.Contains(ResponseCacheHeadersOverrideWarningMessage);
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (1)
34var importMany = contract.MetadataConstraints.Contains(new KeyValuePair<string, object>("IsImportMany", true));
Microsoft.AspNetCore.Authorization.Test (1)
DefaultAuthorizationServiceTests.cs (1)
819if (_allowed.Contains(requirement))
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
241var webJSEndpoint = Assert.Single(endpoints, e => e.Metadata.Contains(obj));
RazorComponentsServiceCollectionExtensionsTest.cs (2)
30if (singleRegistrationServiceTypes.Contains(service.ServiceType)) 59if (singleRegistrationServiceTypes.Contains(service.ServiceType))
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyCultureProvider.cs (1)
89if (!culturesToLoad.Contains(culture))
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
RequestDelegateGenerator.cs (1)
23predicate: static (node, _) => node.TryGetMapMethodName(out var method) && InvocationOperationExtensions.KnownMethods.Contains(method),
RequestDelegateGeneratorSuppressor.cs (1)
65|| !InvocationOperationExtensions.KnownMethods.Contains(method))
Microsoft.AspNetCore.InternalTesting (1)
TestFileOutputContext.cs (1)
129if (InvalidFileChars.Contains(c))
Microsoft.AspNetCore.Mvc.Core.Test (2)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (1)
649.Contains(method));
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (1)
95if (singleRegistrationServiceTypes.Contains(service.ServiceType))
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
266if (singleRegistrationServiceTypes.Contains(service.ServiceType))
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
1039if (!collection.Contains(value))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (5)
src\Servers\Kestrel\shared\KnownHeaders.cs (5)
181ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 252ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 279ClassName = FormattedInternalHeaderNames.Select(x => x.Name).Contains(header) ? "InternalHeaderNames" : "HeaderNames", 303.Where(header => FormattedInternalHeaderNames.Where(x => x.IsPseudoHeader).Select(x => x.Identifier).Contains(header.Identifier)) 937{Each(ApiHeaderNames.Where(header => header != "ContentLength" && !loop.Headers.Select(kh => kh.Identifier).Contains(header)), header => $@"
Microsoft.AspNetCore.SignalR.Core (4)
DefaultHubLifetimeManager.cs (4)
264DefaultHubLifetimeManager<THub>.SendToGroupConnections(methodName, args, group, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, ref tasks, ref message, cancellationToken); 318return SendToAllConnections(methodName, args, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, cancellationToken); 324return SendToAllConnections(methodName, args, (connection, state) => ((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), connectionIds, cancellationToken); 330return SendToAllConnections(methodName, args, (connection, state) => ((IReadOnlyList<string>)state!).Contains(connection.UserIdentifier), userIds, cancellationToken);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
RedisHubLifetimeManager.cs (2)
465if (invocation.ExcludedConnectionIds == null || !invocation.ExcludedConnectionIds.Contains(connection.ConnectionId)) 626if (invocation.ExcludedConnectionIds?.Contains(groupConnection.ConnectionId) == true)
Microsoft.Cci.Extensions (1)
Experimental\FilteredAssembly.cs (1)
461return this.Members.Contains(member);
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1069Debug.Assert(suppressableDiagnostics.Contains(diagnostic));
Syntax\GreenNode.cs (2)
490if (annotationKinds.Contains(a.Kind)) 567if (annotationKinds.Contains(annotation.Kind))
Microsoft.CodeAnalysis.Analyzers (26)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
122if (!diagnosticAnalyzerTypes.Contains(declaredType))
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
284if (!range.Contains('-'))
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (1)
188if (field.Type is INamedTypeSymbol fieldType && fieldType.GetBaseTypesAndThis().Contains(_diagnosticDescriptorType))
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.AnalyzerUtilities (38)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (3)
172if (DisposeOwnershipTransferLikelyTypes.Contains(parameter.Type) || 388DisposeOwnershipTransferLikelyTypes.Contains(operation.Parameter.Type), 391IsDisposableCreationSpecialCase(invocation.TargetMethod) && DisposeOwnershipTransferLikelyTypes.Contains(operation.Parameter.Type),
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
157containingMethod.Parameters.Any(p => _disposeOwnershipTransferLikelyTypes.Contains(p.Type));
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (7)
153if (this.TrackedTypeSymbols.Any(s => operation.Type.GetBaseTypesAndThis().Contains(s))) 224&& this.TrackedTypeSymbols.Any(s => operation.Target.Type.GetBaseTypesAndThis().Contains(s)) 285&& this.TrackedTypeSymbols.Any(s => propertyReferenceOperation.Instance.Type.GetBaseTypesAndThis().Contains(s)) 465if (visitedArgument.Value?.Type != null && this.TrackedTypeSymbols.Any(s => visitedArgument.Value.Type.GetBaseTypesAndThis().Contains(s))) 480&& this.TrackedTypeSymbols.Any(s => visitedInstance.Type.GetBaseTypesAndThis().Contains(s)) 539if (this.TrackedTypeSymbols.Any(s => argumentTypeSymbol.GetBaseTypesAndThis().Contains(s)) 656&& this.TrackedTypeSymbols.Any(s => returnValue.Type.GetBaseTypesAndThis().Contains(s))
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (3)
179analysisEntity = _interproceduralCallStack != null && _interproceduralCallStack.Peek().DescendantsAndSelf().Contains(instanceReference) ? 421Debug.Assert(_interproceduralCallStack.Last().Descendants().Contains(flowCaptureOrReference)); 425Debug.Assert(_controlFlowGraph.DescendantOperations().Contains(flowCaptureOrReference));
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2581originalOperation.Descendants().Contains(operation)) 3678!deconstructionAncestor.Target.Descendants().Contains(operation))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.CodeStyle (25)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (1)
87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
207if (descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
551if (!ineligibleFieldUsages.All(loc => loc.Ancestors().Contains(result.PropertyDeclaration))) 571NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 584NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 629if (!node.AncestorsAndSelf().Contains(propertyDeclaration))
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
122.LastOrDefault(a => a.AncestorsAndSelf().Contains(node));
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
146.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
275.Contains(State.TypeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
174.Contains(state.TypeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
213if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
165n => !memberNames.Contains(n) &&
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
88fieldDeclarators.Contains(declarator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.CSharp (6)
FlowAnalysis\DefiniteAssignment.cs (1)
2347if (!_usedLocalFunctions.Contains(symbol))
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
198if (visitedAssemblies != null && visitedAssemblies.Contains(firstSymbol))
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
1210Debug.Assert(!nonEventFields.Contains(associatedField)); 1732=> MemberNames.Contains(WellKnownMemberNames.CloneMethodName);
Symbols\Source\SourceAssemblySymbol.cs (2)
2404bool foundBadWildcard = _compilation.IsEmitDeterministic && verString?.Contains('*') == true; 2885if (visitedAssemblies != null && visitedAssemblies.Contains(firstSymbol))
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
238type.AllInterfaces.Contains(convertedType)) 261if (IsWellKnownCollectionInterface(convertedType) && type.AllInterfaces.Contains(convertedType))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
374nodesAndTokens[^1] = lastNode.WithTrailingTrivia(lastNode.GetTrailingTrivia().Where(t => !trailingWhitespaceAndComments.Contains(t)));
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
73var statementToUpdateIndex = IndexOf(originalBlockStatements, s => topmostUsingStatements.Contains(s));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (13)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (3)
166Assert.True(changedDocumentIds.Contains(originalDocumentId), "original document was not changed."); 194if (changedDocumentIds.Contains(refDocumentId)) 203Assert.True(changedDocumentIds.Contains(refDocumentId));
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (1)
78if (!orderedCSharpArgumentProviders[i].Metadata.AfterTyped.Contains(orderedCSharpArgumentProviders[i - 1].Metadata.Name))
Completion\CompletionProviders\CompletionProviderOrderTests.cs (1)
110if (!orderedCSharpCompletionProviders[i].Metadata.AfterTyped.Contains(orderedCSharpCompletionProviders[i - 1].Metadata.Name))
Completion\CompletionProviders\SymbolCompletionProviderTests.cs (4)
11506foreach (var item in types.Where(t => t.IsClass && expectedItems.Contains(t.Name))) 11509foreach (var item in types.Where(t => t.IsClass && !expectedItems.Contains(t.Name))) 11512foreach (var item in types.Where(t => !t.IsClass && expectedItems.Contains(t.Name))) 11515foreach (var item in types.Where(t => !t.IsClass && !expectedItems.Contains(t.Name)))
Completion\CompletionServiceTests.cs (1)
232Assert.True(completionList.ItemsList.Select(item => item.DisplayText).Contains(expectedItem));
Structure\CommentStructureTests.cs (2)
40if (token.LeadingTrivia.Contains(trivia)) 44else if (token.TrailingTrivia.Contains(trivia))
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
288Assert.True(snapshot.GetProject(id1).ProjectReferences.Contains(reference), "ProjectReferences did not contain project2");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (18)
Semantics\PatternMatchingTests_Scope.cs (18)
11789compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 11880compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 11975compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12067compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12189compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12409compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12600compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12799compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 12944compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13033compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13194compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13355compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13438compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13517compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13603compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13682compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13743compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify( 13918compilation.GetDiagnostics().Where(d => !exclude.Contains(d.Code)).Verify(
Microsoft.CodeAnalysis.CSharp.Features (10)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
245tupleExpression.Arguments.Count(a => nonConflictReferences.Contains(a.Expression)) == 1)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
112if (!containingType.Interfaces.Contains(symbol))
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (1)
53Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
463localFunctionIdentifiers.Contains(rightmostName.Identifier.ValueText));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
238type.AllInterfaces.Contains(convertedType)) 261if (IsWellKnownCollectionInterface(convertedType) && type.AllInterfaces.Contains(convertedType))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
374nodesAndTokens[^1] = lastNode.WithTrailingTrivia(lastNode.GetTrailingTrivia().Where(t => !trailingWhitespaceAndComments.Contains(t)));
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
73var statementToUpdateIndex = IndexOf(originalBlockStatements, s => topmostUsingStatements.Contains(s));
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
68node.AncestorsAndSelf().Contains(containingLambda.Body))
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
98if (token.GetRequiredParent().Ancestors().Contains(listSyntax))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (40)
Semantics\InterpolationTests.cs (7)
3144verifier.VerifyIL("<top-level-statements-entry-point>", expression.Contains('+') 3196verifier.VerifyIL("<top-level-statements-entry-point>", expression.Contains('+') 4932verifier.VerifyIL(@"<top-level-statements-entry-point>", expression.Contains('+') ? @" 5445verifier.VerifyIL(@"Program.<>c.<<Main>$>b__0_0()", !expression.Contains('+') ? @" 5694verifier.VerifyIL(@"Program.<>c.<<Main>$>b__0_0(bool)", !expression.Contains('+') ? @" 5943verifier.VerifyIL("<top-level-statements-entry-point>", !expression.Contains('+') ? @" 6214verifier.VerifyIL("<top-level-statements-entry-point>", !expression.Contains('+') ? @"
Semantics\LookupPositionTests.cs (1)
3177string[] curr = prev.Where(x => !removed.Contains(x)).ToArray();
Semantics\NullableReferenceTypesTests.cs (2)
35014return expectedType.Contains('?') || expectedType.Contains('!');
Semantics\RawInterpolationTests_Handler.cs (27)
1514verifier.VerifyIL("<top-level-statements-entry-point>", expression.Contains('+') 1566verifier.VerifyIL("<top-level-statements-entry-point>", expression.Contains('+') 2025if (expression.Contains('+')) 2120if (expression.Contains('+')) 2645if (expression.Contains('+')) 2765if (expression1.Contains('+')) 2815if (expression1.Contains('+')) 3652verifier.VerifyIL(@"Program.<>c.<<Main>$>b__0_0()", !expression.Contains('+') ? @" 3778if (expression.Contains('+')) 3923verifier.VerifyIL(@"Program.<>c.<<Main>$>b__0_0(bool)", !expression.Contains('+') ? @" 4082if (expression.Contains('+')) 4102if (expression.Contains('+')) 4195verifier.VerifyIL("<top-level-statements-entry-point>", !expression.Contains('+') ? @" 4463verifier.VerifyIL("<top-level-statements-entry-point>", !expression.Contains('+') ? @" 5086Diagnostic(ErrorCode.ERR_TypeIsNotAnInterpolatedStringHandlerType, "InterpolatedStringHandlerArgumentAttribute").WithArguments("string").WithLocation(expression.Contains('+') ? 12 : 10, 27)); 5151Diagnostic(ErrorCode.ERR_BadArgType, "1").WithArguments("1", "int", "string").WithLocation(expression.Contains('+') ? 12 : 10, 70)); 5191Diagnostic(ErrorCode.ERR_InvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute(""NonExistant"")").WithArguments("NonExistant", "C.M(CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 27)); 5278Diagnostic(ErrorCode.ERR_InvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute(""i"", ""NonExistant"")").WithArguments("NonExistant", "C.M(int, CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 34)); 5365Diagnostic(ErrorCode.ERR_InvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute(""NonExistant1"", ""NonExistant2"")").WithArguments("NonExistant1", "C.M(int, CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 34), 5368Diagnostic(ErrorCode.ERR_InvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute(""NonExistant1"", ""NonExistant2"")").WithArguments("NonExistant2", "C.M(int, CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 34)); 5455Diagnostic(ErrorCode.ERR_CannotUseSelfAsInterpolatedStringHandlerArgument, @"InterpolatedStringHandlerArgumentAttribute(""c"")").WithLocation(expression.Contains('+') ? 12 : 10, 34)); 5542Diagnostic(ErrorCode.ERR_NullInvalidInterpolatedStringHandlerArgumentName, "InterpolatedStringHandlerArgumentAttribute(new string[] { null })").WithLocation(expression.Contains('+') ? 12 : 10, 34)); 5723Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute("""")").WithArguments("C.M(CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 27)); 5812Diagnostic(ErrorCode.ERR_NotInstanceInvalidInterpolatedStringHandlerArgumentName, @"InterpolatedStringHandlerArgumentAttribute("""")").WithArguments("C.C(CustomHandler)").WithLocation(expression.Contains('+') ? 12 : 10, 15)); 5901Diagnostic(ErrorCode.ERR_TypeIsNotAnInterpolatedStringHandlerType, "InterpolatedStringHandlerArgumentAttribute").WithArguments("T").WithLocation(expression.Contains('+') ? 12 : 10, 27)); 6032Diagnostic(ErrorCode.WRN_ParameterOccursAfterInterpolatedStringHandlerParameter, @"InterpolatedStringHandlerArgumentAttribute(""i"")").WithArguments("i", "c").WithLocation(expression.Contains('+') ? 12 : 10, 27)); 6074Diagnostic(ErrorCode.WRN_ParameterOccursAfterInterpolatedStringHandlerParameter, @"InterpolatedStringHandlerArgumentAttribute(""i"")").WithArguments("i", "c").WithLocation(expression.Contains('+') ? 12 : 10, 27));
Semantics\VarianceTests.cs (2)
115if (!validAssignments[i].Contains(j)) 228if (!validAssignments[i].Contains(j))
SourceGeneration\GeneratorDriverTests.cs (1)
2718Assert.True(compilation.SyntaxTrees.Contains(node.SyntaxTree));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Compilation\CompilationAPITests.cs (5)
1194Assert.True(comp.References.Contains(compRef1)); 1195Assert.True(comp.References.Contains(compRef2)); 1203Assert.True(comp.References.Contains(ref1)); 1208Assert.True(comp.References.Contains(ref2)); 1213Assert.True(comp.References.Contains(compRef2));
Compilation\IndexedProperties_BindingTests.cs (4)
173Assert.True(actual_lookupSymbols_as_string.Contains("void B.Main(System.String[] args)"), "LookupSymbols does not contain Main"); 174Assert.True(actual_lookupSymbols_as_string.Contains("System"), "LookupSymbols does not contain System"); 175Assert.True(actual_lookupSymbols_as_string.Contains("IA"), "LookupSymbols does not contain IA"); 176Assert.True(actual_lookupSymbols_as_string.Contains("A"), "LookupSymbols does not contain A");
Symbols\Metadata\PE\TypeForwarders.cs (1)
1800if (expectedFullName.Contains('+'))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
477if (!directiveKinds.Contains(kind))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
Microsoft.CodeAnalysis.EditorFeatures (6)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (5)
65if (value is ICodeStyleOption2 codeStyleOption && !optionValue.Contains(':')) 277return language.HasFlag(Language.CSharp) && !language.HasFlag(Language.VisualBasic) && splicedFileExtensions.Contains("cs") && splicedFileExtensions.Length == 1; 282return language.HasFlag(Language.VisualBasic) && !language.HasFlag(Language.CSharp) && splicedFileExtensions.Contains("vb") && splicedFileExtensions.Length == 1; 287return language.HasFlag(Language.VisualBasic) && language.HasFlag(Language.CSharp) && splicedFileExtensions.Contains("vb") && splicedFileExtensions.Contains("cs");
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
197_activeSpan = _activeSpan.HasValue && spans.Contains(_activeSpan.Value)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Extensions\ExportProviderExtensions.cs (1)
27return Assert.IsType<TCommandHandler>(lazyCommandHandlers.Single(lazyCommandHandler => lazyCommandHandler.Metadata.Name == name && lazyCommandHandler.Metadata.ContentTypes.Contains(contentType)).Value);
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
106Assert.False(testState.Workspace.Documents.Select(d => d.Id).Contains(result.NavigationDocumentId));
Workspaces\EditorTestWorkspace.cs (2)
208return values.Single(value => value.Metadata.ContentTypes.Contains(contentType)).Value; 214return values.Single(value => value.Metadata.Name == name && value.Metadata.ContentTypes.Contains(contentType)).Value;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeActions\CodeChangeProviderMetadataTests.cs (1)
181.Where(part => ((string[])part.Export.Metadata["Languages"]!).Contains(language));
EmbeddedLanguages\StackFrame\StackFrameSyntaxFactory.cs (1)
107Assert.True(s.Contains('.'));
SymbolFinder\SymbolFinderTests.cs (1)
458Assert.True(transitiveDerived.All(d => d.GetBaseTypes().Contains(rootType)), "All results must transitively derive from the type");
Microsoft.CodeAnalysis.Extensions.Package (2)
Symbols\ISymbolExtensions.cs (1)
265&& kinds.Contains(symbol.Kind);
Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.ExternalAccess.Xaml (3)
External\ConversionHelpers.cs (1)
21var clientSupportsMarkdown = context.ClientCapabilities?.TextDocument?.Hover?.ContentFormat?.Contains(LSP.MarkupKind.Markdown) == true;
Internal\ClientCapabilityProvider.cs (2)
23=> _clientCapabilities.TextDocument?.Completion?.CompletionItem?.DocumentationFormat?.Contains(MarkupKind.Markdown) == true; 26=> _clientCapabilities.TextDocument?.Completion?.CompletionListSetting?.ItemDefaults?.Contains("data") == true;
Microsoft.CodeAnalysis.Features (24)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
111.Contains(compilation.GetTypeByMetadataName("System.Diagnostics.DebuggerDisplayAttribute"));
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
101=> symbol.DeclaringSyntaxReferences.Any(static (r, compilation) => compilation.SyntaxTrees.Contains(r.SyntaxTree), compilation);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
117if (property.Ancestors().Contains(typeBlock))
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
279if (collectionType.TypeKind == TypeKind.Interface && knownCollectionInterfaces.Contains(collectionType.OriginalDefinition)) 295if (!knownCollectionInterfaces.Contains(current.OriginalDefinition))
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
474return containingFunction.AncestorsAndSelf().Contains(forStatement);
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
58var orderedFeatureProviders = ExtensionOrderer.Order(allServices).Where(c => c.Metadata.Languages.Contains(languageName)).ToImmutableArray();
GenerateType\AbstractGenerateTypeService.cs (1)
148.FirstOrDefault(node.GetAncestorsOrThis<SyntaxNode>().Contains);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
552if (symbolSyntax.Ancestors().Contains(typeDeclaration))
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
589if (initializer?.DescendantNodesAndSelf().Contains(calleeMethodInvocationNode) is true)
MetadataAsSource\MetadataAsSourceFileService.cs (1)
214if (workspace.GetOpenDocumentIds().Contains(documentId))
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (1)
87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
207if (descriptor.CustomTags.Contains(WellKnownDiagnosticTags.NotConfigurable))
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
551if (!ineligibleFieldUsages.All(loc => loc.Ancestors().Contains(result.PropertyDeclaration))) 571NonConstructorLocations(writeLocations1).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 584NonConstructorLocations(writeLocations2).Any(loc => !loc.Ancestors().Contains(result.PropertyDeclaration))) 629if (!node.AncestorsAndSelf().Contains(propertyDeclaration))
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
122.LastOrDefault(a => a.AncestorsAndSelf().Contains(node));
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
146.Any(nameAttributes => nameAttributes.Select(GetValueFromNameAttribute).Contains(name));
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
275.Contains(State.TypeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
174.Contains(state.TypeToGenerateIn);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
213if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
165n => !memberNames.Contains(n) &&
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
88fieldDeclarators.Contains(declarator)
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Handler\CodeActions\CodeActionHelpers.cs (1)
293if (diagnosticCodesFixedByAction.Contains(diagnosticCode))
Handler\CodeLens\CodeLensHandler.cs (1)
135var testContainerMembers = members.Where(member => testContainerNodes.Contains(member.Node));
Handler\SemanticTokens\SemanticTokensSchema.cs (1)
112.Where(tokenType => !SemanticTokenTypes.AllTypes.Contains(tokenType))
LspServices\AbstractExportLspServiceAttribute.cs (1)
60Contract.ThrowIfFalse(serviceType.GetInterfaces().Contains(typeof(ILspService)), $"{serviceType.Name} does not inherit from {nameof(ILspService)}");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
ProtocolConversionsTests.cs (2)
34if (invalidFileNameChars.Contains(c)) 43var expectedAbsoluteUri = "file:///" + uriPrefix + (unescaped.Contains(c) ? c : "%" + ((int)c).ToString("X2")) + "/";
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Microsoft.CodeAnalysis.PublicApiAnalyzers (22)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspace.SolutionCreator.cs (1)
192Contract.ThrowIfFalse(oldProjectIdToChecksum.Keys.All(newProjectIdToChecksum.Keys.Contains));
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
AbstractResxGenerator.cs (1)
43var hasAggressiveInlining = methodImplOptions?.MemberNames.Contains(nameof(MethodImplOptions.AggressiveInlining)) ?? false;
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Microsoft.CodeAnalysis.Test.Utilities (4)
Assert\EqualityUtil`1.cs (1)
135Assert.True(type.GetTypeInfo().ImplementedInterfaces.Contains(targetType));
Compilation\CompilationExtensions.cs (1)
151var isAddedSymbol = new Func<ISymbol, bool>(s => allAddedSymbols?.Contains(s) ?? false);
Platform\Desktop\DesktopRuntimeEnvironment.cs (1)
90.Where(x => missingList.Contains(x.Id))
TargetFrameworkUtil.cs (1)
402.Where(x => !(x is PortableExecutableReference pe && excludeReferenceNames.Contains(pe.FilePath)));
Microsoft.CodeAnalysis.UnitTests (10)
Collections\ImmutableSegmentedListTest.cs (2)
364list = list.RemoveAll(removeList.Contains); 387list2 = list2.RemoveAll(removeList.Contains);
Collections\List\ICollection.Generic.Tests.cs (3)
568if (!IsReadOnly && !AddRemoveClear_ThrowsNotSupported && DefaultValueAllowed && !Enumerable.Contains(InvalidValues, default(T))) 592while (collection.Contains(value) || Enumerable.Contains(InvalidValues, value)) 603if (!IsReadOnly && !AddRemoveClear_ThrowsNotSupported && DefaultValueAllowed && !Enumerable.Contains(InvalidValues, default(T)))
Collections\List\IList.NonGeneric.Tests.cs (4)
51while (collection.Contains(toAdd) || InvalidValues.Contains(toAdd)) 878if (!IsReadOnly && !ExpectedFixedSize && NullAllowed && !Enumerable.Contains(InvalidValues, null)) 902while (list.Contains(value) || Enumerable.Contains(InvalidValues, value)) 921if (!IsReadOnly && !ExpectedFixedSize && NullAllowed && !Enumerable.Contains(InvalidValues, null))
PEWriter\InstructionOperandTypesTests.cs (1)
27foreach (FieldInfo fi in typeof(OpCodes).GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => !reserved.Contains(f.Name)))
Microsoft.CodeAnalysis.Workspaces (53)
CodeFixes\ExportCodeFixProviderAttribute.cs (1)
53if (kind == null || !s_documentKindNames.Contains(kind))
CodeFixesAndRefactorings\FixAllProviderInfo.cs (1)
122=> supportedDiagnosticIds.Contains(diagnostic.Id);
CodeRefactorings\ExportCodeRefactoringProviderAttribute.cs (1)
49if (kind == null || !s_documentKindNames.Contains(kind))
FindSymbols\SymbolFinder_Hierarchy.cs (1)
165if (interfaceType.MemberNames.Contains(nameToLookFor))
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
89var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id));
Log\KeyValueLogMessage.cs (3)
218Debug.Assert(str != null && !str.Contains(PairSeparator) && !str.Contains(KeyValueSeparator) && !str.Contains(ItemSeparator));
Rename\ConflictEngine\MutableConflictResolution.cs (1)
55RelatedLocations.RemoveAll(r => conflictLocationDocumentIds.Contains(r.DocumentId));
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
244return _singletonListeners.Where(kv => featureNames.Contains(kv.Key)).Select(kv => (IAsynchronousOperationWaiter)kv.Value);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Workspace\Host\EventListener\EventListenerTracker.cs (1)
27.Where(l => l.Metadata.WorkspaceKinds.Contains(workspaceKind))
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
1321return _projectSystemProjectFactory.Workspace.CurrentSolution.GetRequiredProject(Id).AllProjectReferences.Contains(projectReference);
Workspace\Solution\ProjectDependencyGraph.cs (1)
577return GetProjectsThatTransitivelyDependOnThisProject(potentialDependency).Contains(id);
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
180if (referencedProjectIds.Contains(projectIdToUpdate) || existingReverseTransitiveReferences?.Overlaps(referencedProjectIds) == true)
Workspace\Solution\Solution.cs (5)
660if (!oldProject.ProjectReferences.Contains(projectReference)) 752if (!oldProject.MetadataReferences.Contains(metadataReference)) 839if (!oldProject.AnalyzerReferences.Contains(analyzerReference)) 894if (this.SolutionState.AnalyzerReferences.Contains(analyzerReference)) 914if (!this.SolutionState.AnalyzerReferences.Contains(analyzerReference))
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
105Contract.ThrowIfTrue(this.CompilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None))); 205Contract.ThrowIfTrue(compilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
Workspace\Solution\SolutionState.cs (3)
1400=> GetRequiredProjectState(projectId).ProjectReferences.Contains(projectReference); 1403=> GetRequiredProjectState(projectId).MetadataReferences.Contains(metadataReference); 1406=> GetRequiredProjectState(projectId).AnalyzerReferences.Contains(analyzerReference);
Workspace\Workspace.cs (9)
1509if (!project.ProjectReferences.Contains(newProjRef)) 2393if (!this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2406if (this.CurrentSolution.GetProject(fromProjectId)!.ProjectReferences.Contains(projectReference)) 2433if (!this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2444if (this.CurrentSolution.GetProject(projectId)!.MetadataReferences.Contains(metadataReference)) 2455if (!this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2466if (this.CurrentSolution.GetProject(projectId)!.AnalyzerReferences.Contains(analyzerReference)) 2477if (!solution.AnalyzerReferences.Contains(analyzerReference)) 2488if (solution.AnalyzerReferences.Contains(analyzerReference))
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (1)
635if (!project.MetadataReferences.Contains(metadataReference))
MSBuild\ProjectFileExtensionRegistry.cs (1)
63if (_solutionServices.SupportedLanguages.Contains(language) &&
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
1883Assert.True(options.PreprocessorSymbolNames.Contains("EnableMyAttribute")); 1906Assert.False(options.PreprocessorSymbolNames.Contains("EnableMyAttribute"));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Options\NamingStyleTestUtilities.cs (1)
38if (excludeNodes != null && excludeNodes.Contains(element.Name.LocalName))
Workspaces\TestWorkspace_XmlConsumption.cs (1)
371if (!Services.SupportedLanguages.Contains(languageName))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
2883Assert.True(compilation.References.Contains(meta), "Compilation references were expected to contain " + meta);
Microsoft.DotNet.Build.Tasks.Feed (7)
src\model\SetupTargetFeedConfigV3.cs (4)
146if (PublishingConstants.InstallersAndChecksums.Contains(type)) 154if (IsStableBuild && ((PublishingConstants.Packages.Contains(type) && spec.Assets == AssetSelection.ShippingOnly) || type is TargetFeedContentType.Symbols)) 161if (PublishingConstants.Packages.Contains(type) && 167else if (PublishingConstants.Packages.Contains(type) &&
src\model\SetupTargetFeedConfigV4.cs (2)
134if (PublishingConstants.Packages.Contains(type) && 140else if (PublishingConstants.Packages.Contains(type) &&
src\model\TargetChannelConfig.cs (1)
187if (assets == AssetSelection.All && contentTypes.Contains(TargetFeedContentType.Package))
Microsoft.DotNet.Build.Tasks.Workloads (1)
Swix\SwixComponent.cs (1)
200if (pack.IsAlias && pack.AliasTo != null && !pack.AliasTo.Keys.Any(rid => s_SupportedRids.Contains(rid)))
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSourceGenerator.cs (1)
53referenceTypes = referenceTypes.Where(type => !OmitTypes.Contains(type));
NotSupportedAssemblyGenerator.cs (4)
118if (_exclusionApis != null && _exclusionApis.Contains(GetMethodDefinition(node))) 135if (_exclusionApis != null && _exclusionApis.Contains(GetPropertyDefinition(node))) 143if (_exclusionApis != null && _exclusionApis.Contains(GetEventDefinition(node))) 151if (_exclusionApis != null && _exclusionApis.Contains(GetFullyQualifiedName(node)))
SourceGenerator.cs (1)
73if (_seedTypePreferences.Keys.Contains(type))
Microsoft.DotNet.Helix.Sdk (1)
SendHelixJob.cs (1)
311if (name.Contains('%'))
Microsoft.DotNet.Helix.Sdk.Tests (2)
InstallDotNetToolTests.cs (2)
238It.Is<IEnumerable<string>>(args => args.All(y => _expectedArgs.Contains(y))))) 309It.Is<IEnumerable<string>>(args => args.Count() == _expectedArgs.Count() && args.All(y => _expectedArgs.Contains(y)))),
Microsoft.DotNet.SharedFramework.Sdk (1)
src\GenerateSharedFrameworkDepsFile.cs (1)
103.Where(expansion => expansion.Contains(RuntimeIdentifier))
Microsoft.DotNet.SignCheckLibrary (2)
Verification\ExeVerifier.cs (1)
30if (PEHeader.ImageSectionHeaders.Select(s => s.SectionName).Contains(".wixburn"))
Verification\Jar\JarAttributes.cs (1)
57if (line.Contains(':'))
Microsoft.DotNet.SignTool (1)
src\BatchSignUtil.cs (1)
663if (_itemsToSkipStrongNameCheck.Contains(file.FileName))
Microsoft.DotNet.XliffTasks (2)
Model\XamlRuleDocument.cs (2)
110if (localizableProperties.Contains(attribute.Name.LocalName)) 215return localName.Contains('.') ? localName.Split('.').Last() : localName;
Microsoft.Extensions.Configuration (1)
ConfigurationManager.cs (1)
311return _properties.Contains(item);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Linux\AcceptanceTest.cs (2)
520if (tagsArray.Contains(new KeyValuePair<string, object?>("cpu.mode", "user"))) 524else if (tagsArray.Contains(new KeyValuePair<string, object?>("cpu.mode", "system")))
Microsoft.Extensions.FileProviders.Embedded.Tests (1)
TestAssembly.cs (1)
59return Files.Contains(name) ? Stream.Null : null;
Microsoft.Extensions.Http.Resilience (1)
Polly\HttpRetryStrategyOptionsExtensions.cs (1)
58return !methods.Contains(request.Method);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Emitter.cs (1)
178!lm.Message.Contains('{') ? "" :
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Program.cs (1)
14.Where(t => t.GetInterfaces().Contains(typeof(IFuzzer)))
Microsoft.Extensions.Validation.ValidationsGenerator (1)
Parsers\ValidationsGenerator.EndpointsParser.cs (1)
24return method == "MapMethods" || InvocationOperationExtensions.KnownMethods.Contains(method);
Microsoft.Gen.Logging (1)
Parsing\TypeSymbolExtensions.cs (1)
74symbols.IgnorePropertiesSymbols.Contains(typeSymbol);
Microsoft.Interop.SourceGeneration (4)
Marshalling\ElementsMarshalling.cs (1)
574if (UsesLastIndexMarshalled(CollectionSource.TypeInfo, CollectionSource.CodeContext) && stagesToGeneratePerElement.Contains(StubIdentifierContext.Stage.Marshal))
TypeSymbolExtensions.cs (3)
332if (typeName.Contains('<') || typeName.Contains('+') || typeName.Contains('/'))
Microsoft.Maui (1)
VisualDiagnostics\VisualDiagnosticsOverlay.cs (1)
54 if (!ScrollViews.Contains(scrollBar))
Microsoft.Maui.Controls (13)
BindingExpression.cs (1)
407 if (bindablePropertyField != null && bindablePropertyField.FieldType == typeof(BindableProperty) && sourceType.ImplementedInterfaces.Contains(typeof(IElementController)))
BindingExpressionHelper.cs (2)
34 if (stringValue.EndsWith(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator, StringComparison.Ordinal) && DecimalTypes.Contains(convertTo)) 41 if (stringValue == "-0" && DecimalTypes.Contains(convertTo))
ListProxy.cs (1)
81 return _items.Values.Contains(item);
MultiPage.cs (1)
351 if (selected == null || !ItemsSource.Cast<object>().Contains(selected))
NavigationPage\NavigationPage.cs (1)
525 var rootPage = this.FindParentWith(x => (x is IWindow te || Window.Navigation.ModalStack.Contains(x)), true);
ReadOnlyListAdapter.cs (1)
63 return _list.Contains(value);
ResourceDictionary.cs (1)
169 || (_mergedInstance != null && _mergedInstance.Contains(item));
Shell\BaseShellItem.cs (1)
134 return shell.GetItems().Contains(this);
Shell\ShellItem.cs (1)
267 if (CurrentItem == null && ((IShellItemController)this).GetItems().Contains(child))
Shell\ShellSection.cs (2)
436 if (Navigation.ModalStack.Contains(navStack[navStack.Count - 1])) 709 if (CurrentItem == null && ((IShellSectionController)this).GetItems().Contains(child))
StyleSheets\TextReaderExtensions.cs (1)
66 if (limit != null && limit.Contains(c))
Microsoft.Maui.Controls.Build.Tasks (3)
SetPropertiesVisitor.cs (1)
245 attributes.FirstOrDefault(cad => ContentPropertyAttribute.ContentPropertyTypes.Contains(cad.AttributeType.FullName));
TypeReferenceExtensions.cs (2)
227 if (arrayInterfaces.Contains(baseClass.FullName)) 230 arrayGenericInterfaces.Contains(baseClass.ResolveCached(cache).FullName) &&
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
486 if (!new[] { "private", "public", "internal", "protected" }.Contains(accessModifier)) //quick validation
Microsoft.Maui.Controls.Xaml (1)
ApplyPropertiesVisitor.cs (1)
291 attributes.FirstOrDefault(cad => ContentPropertyAttribute.ContentPropertyTypes.Contains(cad.AttributeType.FullName));
Microsoft.Maui.Essentials (1)
Preferences\Preferences.shared.cs (1)
288 if (!SupportedTypes.Contains(type))
Microsoft.ML.AutoML (8)
API\AutoCatalog.cs (1)
825var booleanFeatures = columnPurposes.Where(c => c.Purpose == ColumnPurpose.NumericFeature && !numericFeatures.Contains(c));
Experiment\OptimizingMetricInfo.cs (3)
31IsMaximizing = !_minimizingRegressionMetrics.Contains(regressionMetric); 36IsMaximizing = !_minimizingBinaryMetrics.Contains(binaryMetric); 41IsMaximizing = !_minimizingMulticlassMetrics.Contains(multiMetric);
TrainerExtensions\TrainerExtensionCatalog.cs (1)
107trainers = trainers.Where(t => allowList.Contains(GetTrainerName(t)));
TrainerExtensions\TrainerExtensionUtil.cs (2)
92var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name)); 170var boosterParams = sweepParams.Where(p => _lightGbmBoosterParamNames.Contains(p.Name));
Utils\UserInputValidationUtil.cs (1)
150if (columns?.Contains(null) == true)
Microsoft.ML.AutoML.Tests (1)
Utils\TaskAgnosticIterationResult.cs (1)
76if (!supportedTypes.Contains(metric.GetType()))
Microsoft.ML.Core (6)
ComponentModel\ComponentCatalog.cs (5)
741.Where(info => info.SignatureTypes.Contains(typeSig) && typeBase.IsAssignableFrom(info.Type)) 784.Where(ci => ci.LoadNames.Select(n => n.ToLowerInvariant().Trim()).Contains(name)) 793.Where(ci => ci.SignatureTypes.Contains(typeof(TSig))) 803.Where(ci => ci.ArgType == typeof(TArgs) && ci.SignatureTypes.Contains(typeof(TSig))) 875component = _components.FirstOrDefault(x => x.InterfaceType == interfaceType && (x.Name == alias || (x.Aliases != null && x.Aliases.Contains(alias))));
Utilities\ReservoirSampler.cs (1)
195Contracts.Assert(_counts.Contains(0));
Microsoft.ML.Data (17)
DataLoadSave\Text\TextLoader.cs (4)
1245if (!options.AllowQuoting && options.DecimalMarker == ',' && _separators.Contains(',')) 1249if (_separators.Contains(_escapeChar)) 1456if (_separators.Contains(':')) 1471host.CheckDecode(!_separators.Contains(_escapeChar));
DataLoadSave\Text\TextLoaderParser.cs (1)
1359Contracts.Assert(_seps.Contains(span[ichCur]));
DataView\CompositeRowToRowMapper.cs (2)
64bool wantsActive = activeIndices.Contains(c); 78deps[deps.Length - 1] = OutputSchema.Where(c => activeIndices.Contains(c.Index));
DataView\TypedCursor.cs (2)
193return col => _columnIndices.Contains(col) || additionalColumnsPredicate(col); 208var inputs = _data.GetRowCursorSet(_data.Schema.Where(col => _columnIndices.Contains(col.Index) || additionalColumnsPredicate(col.Index)), n, rand);
Dirty\PredictionUtils.cs (1)
74if (!arg.Contains(';') || arg.IndexOfAny(_dontSplitChars) >= 0)
Scorers\FeatureContributionCalculation.cs (1)
371if (activeColumns.Select(c => c.Index).Contains(_outputGenericSchema.Count))
Scorers\SchemaBindablePredictorWrapper.cs (1)
241if (activeColumns.Select(c => c.Index).Contains(0))
Transforms\ColumnBindingsBase.cs (1)
190if (src.Contains(':'))
Transforms\ColumnSelecting.cs (4)
102_selectPredicate = (name) => (keepColumns != null) ? keepColumns.Contains(name) : !dropColumns.Contains(name); 463var missing = selectColumns.Where(x => !inputColumns.Contains(x)); 605if (selectedColumns.Contains(inputSchema[colIdx].Name))
Microsoft.ML.FastTree (3)
TreeEnsembleFeaturizer.cs (3)
195if (activeIndices.Contains(OutputSchema[_treesColumnName].Index)) 205if (activeIndices.Contains(OutputSchema[_leavesColumnName].Index)) 215if (activeIndices.Contains(OutputSchema[_pathsColumnName].Index))
Microsoft.ML.GenAI.LLaMA (1)
Llama3_1ChatTemplateBuilder.cs (1)
28if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false))
Microsoft.ML.GenAI.Phi (1)
Phi3\Phi3ChatTemplateBuilder.cs (1)
33if (messages.Any(m => m.GetRole() is null || availableRoles.Contains(m.GetRole()!.Value) == false))
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
156if (shortName.Split(',').Contains(nameArgValue))
Microsoft.ML.OnnxConverter (1)
OnnxExportExtensions.cs (1)
31if (!outputColumnNamesToKeep.Contains(sink.Schema[i].Name))
Microsoft.ML.SearchSpace (2)
Parameter.cs (1)
334return (_value as Dictionary<string, Parameter>).Contains(item);
SearchSpace.cs (1)
304Contract.Assert(supportTypes.Contains(type) || type.IsEnum, $"[Option:{optionName}] ChoiceAttribute can only apply to enum or the following types {string.Join(",", supportTypes.Select(x => x.Name))}");
Microsoft.ML.StandardTrainers (2)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (2)
109var active0 = activeIndices.Contains(0); 110var active1 = activeIndices.Contains(1);
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
527if (paramValue.Contains(','))
Microsoft.ML.TimeSeries (2)
SrCnnEntireAnomalyDetector.cs (2)
911if (!anomalyIdxList.Contains(i)) 925if (!anomalyIdxList.Contains(i))
Microsoft.ML.TorchSharp (2)
Utils\DefaultDictionary.cs (1)
67return _dictionary.Contains(item);
Utils\FileUtils.cs (1)
48if (!_validTypes.Contains(typeof(T)))
Microsoft.ML.Transforms (1)
Text\WordEmbeddingsExtractor.cs (1)
716if (!firstValue.Contains(Single.NaN))
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
329var cols = input.Schema.Where(c => inputColIndices.Contains(c.Index));
Microsoft.VisualStudio.LanguageServices (4)
EditAndContinue\EditAndContinueFeedbackDiagnosticFileProvider.cs (1)
151return JObject.Parse(content)["processIds"] is JContainer pidCollection && pidCollection.Values<int>().Contains(_vsProcessId);
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
72var defaultTypeName = NameGenerator.GenerateUniqueName(candidateName, name => !conflictingTypeNames.Contains(name));
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
36GetDocumentIds(fromProject).Contains(DocumentId))
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (1)
236if (project != null && projectIds.Contains(project.Id))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
182if (symbol is ILocalSymbol localSymbol && !symbol.DeclaringSyntaxReferences.Any(static (d, token) => d.GetSyntax().DescendantTokens().Contains(token), token))
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\RemoteLanguageServiceWorkspace.cs (1)
479if (_openedDocs.Values.Contains(documentId) || IsDocumentOpen(documentId))
Client\RoslynLSPClientService.cs (3)
43if (collaborationSession.RemoteServiceNames.Contains(languageSpecificLspServerProviderName)) 47else if (collaborationSession.RemoteServiceNames.Contains(roslynLspServerProviderName)) 51else if (collaborationSession.RemoteServiceNames.Contains(anyLspServerProviderName))
Roslyn.Diagnostics.Analyzers (23)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
450if (attributes.Contains(attributeToRemove))
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
50return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.Drawing.Common.Tests (1)
System\Drawing\FontConverterTests.cs (1)
193return installedFonts.Families.Select(t => t.Name).Contains(string.Empty);
System.Linq (12)
System\Linq\AppendPrepend.SpeedOpt.cs (2)
182_source.Contains(value); 299return _source.Contains(value);
System\Linq\Concat.SpeedOpt.cs (3)
153_first.Contains(value) || 154_second.Contains(value); 356if (node._head.Contains(value))
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
90_source.Contains(value) :
System\Linq\Distinct.SpeedOpt.cs (1)
25_comparer is null ? _source.Contains(value) :
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
231_source.Contains(value);
System\Linq\Reverse.SpeedOpt.cs (1)
120public override bool Contains(TSource value) => _source.Contains(value);
System\Linq\SelectMany.SpeedOpt.cs (1)
70if (_selector(element).Contains(value))
System\Linq\Shuffle.SpeedOpt.cs (1)
89return _source.Contains(value);
System\Linq\Union.SpeedOpt.cs (1)
60if (source.Contains(value))
System.Linq.Expressions (2)
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
88(_scope.MergedScopes == null || !_scope.MergedScopes.Contains(node)))
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
398}.Contains(Convert.GetTypeCode(from)));
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
129if (t.IsGenericType && t.GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IGrouping<,>)))
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
462if (onLoadData.NamedTypesToBeProtected.Contains(symbol.ContainingSymbol))
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Emitter.cs (1)
3693overlap = literal.SetChars.Contains(node.Ch);
UpgradeToGeneratedRegexCodeFixer.cs (1)
298if (argument.Value.ConstantValue.Value is string str && str.Contains('\\'))
System.Windows.Forms (5)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (1)
41bool IList.Contains(object? value) => _items.Contains(value);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (1)
43bool IList.Contains(object? value) => _items.Contains(value);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
299bool IList.Contains(object? value) { return InnerList.Contains(value); }
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (1)
113bool IList.Contains(object? value) { return InnerList.Contains(value); }
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (1)
176bool IList.Contains(object? value) { return InnerList.Contains(value); }
System.Windows.Forms.Design (3)
System\ComponentModel\Design\SelectionService.cs (1)
333return _selection is not null && _selection.Contains(component);
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (2)
198if (_ignoreAddingList is not null && _ignoreAddingList.Contains(e.Component)) 243if (_ignoreAddedList is not null && _ignoreAddedList.Contains(e.Component))
System.Windows.Forms.Design.Tests (2)
EnsureDesignerTests.cs (1)
24Assert.True(forwardedTypes.Contains(designer.FullName), $"{designer.FullName} must be type forwarded");
EnsureEditorsTests.cs (1)
37Assert.True(forwardedTypes.Contains(editor.FullName), $"{editor.FullName} must be type forwarded");
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
71if (items is null || items.Contains(default))
Test.Utilities (22)
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
265&& kinds.Contains(symbol.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
Text.Analyzers (23)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
635if (pathParts.Contains(ThisDirectory))
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
87disallowedCatchTypes.Contains(type) ||
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
375!nestedLambdasAndLocalFunctions.Contains(symbol.ContainingSymbol.OriginalDefinition))
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
80if (allInterfaces.Contains(candidateBaseType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
266var match = list.FirstOrDefault(o => o != null && o.Tokens.Contains(token));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
160return compilation.SyntaxTrees.Contains(firstNonNull.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (2)
34if (sequence.Contains((T)null!)) 64if (list.Contains((T)null!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
757type?.AllInterfaces.Contains(iDisposableType) == true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (1)
55service = servicesOfMatchingType.SingleOrDefault(static (lz, workspaceKind) => lz.lazyService?.Metadata.WorkspaceKinds.Contains(workspaceKind) ?? false, workspaceKind);
xunit.assert (2)
EqualityAsserts.cs (2)
329 else if (expectedInterfaceTypeDefinitions != null && actualInterfaceTypeDefinitions != null && expectedInterfaceTypeDefinitions.Contains(typeofSet) && actualInterfaceTypeDefinitions.Contains(typeofSet))
xunit.console (2)
Program.cs (2)
17var internalDiagnosticsMessageSink = DiagnosticMessageSink.ForInternalDiagnostics(consoleLock, args.Contains("-internaldiagnostics"), args.Contains("-nocolor"));