246 references to Where
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
104.Where(a => WellKnownTypes.Implements(a.AttributeClass, modelNameParameter));
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1564Assert.Empty(compilation.GetDiagnostics().Where(diagnostic => diagnostic.Severity > DiagnosticSeverity.Hidden));
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
635foreach (var methodSymbol in targetClassSymbol.GetMembers().Where(m => m.Kind == SymbolKind.Method).OfType<IMethodSymbol>())
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
544return diags.Where(d => _fixer.FixableDiagnosticIds.Contains(d.Id));
Microsoft.Analyzers.Local (1)
ApiLifecycle\AssemblyAnalysis.cs (1)
199.Where(member => member.IsExternallyVisible())
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
545return diags.Where(d => _fixer.FixableDiagnosticIds.Contains(d.Id));
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
86diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
DiagnosticVerifier.cs (1)
109diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
Microsoft.AspNetCore.App.Analyzers (6)
Infrastructure\AmbiguousRoutePatternComparer.cs (2)
103var xParameterPolicies = x.ParameterParts.Where(p => p.Kind == RoutePatternKind.ParameterPolicy).OfType<RoutePatternPolicyParameterPartNode>().ToList(); 104var yParameterPolicies = y.ParameterParts.Where(p => p.Kind == RoutePatternKind.ParameterPolicy).OfType<RoutePatternPolicyParameterPartNode>().ToList();
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
63foreach (var matchingParameter in resolvedParameters.Where(s => string.Equals(s.RouteParameterName, parameterName, StringComparison.OrdinalIgnoreCase)))
RouteHandlers\AtMostOneFromBodyAttribute.cs (3)
25var asParametersDecoratedParameters = methodSymbol.Parameters.Where(p => p.HasAttribute(asParametersAttributeType)); 29var fromBodyMetadataInterfaceMembers = asParameterDecoratedParameter.Type.GetMembers().Where( 39var fromBodyMetadataInterfaceParameters = methodSymbol.Parameters.Where(p => p.HasAttributeImplementingInterface(fromBodyMetadataInterfaceType));
Microsoft.AspNetCore.Http.Extensions.Tests (6)
RequestDelegateGenerator\CompileTimeCreationTests.cs (4)
71Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 97Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 179Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 740Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
75Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 151Assert.Empty(result.Diagnostics.Where(d => d.Severity > DiagnosticSeverity.Warning));
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
75Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 151Assert.Empty(result.Diagnostics.Where(d => d.Severity > DiagnosticSeverity.Warning));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\EndpointParameter.cs (1)
469var constructors = type.Constructors.Where(constructor => constructor.DeclaredAccessibility == Accessibility.Public && !constructor.IsStatic);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
HubClientProxyGenerator.Parser.cs (2)
285.Where(member => member.Kind == SymbolKind.Method) 289.Where(member => member.Kind == SymbolKind.Method)
HubServerProxyGenerator.Parser.cs (2)
262.Where(member => member.Kind == SymbolKind.Method) 266.Where(member => member.Kind == SymbolKind.Method)
Microsoft.CodeAnalysis (9)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1049var suppressableDiagnostics = reportedDiagnostics.Where(d => !d.IsSuppressed &&
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
377analyzers = analyzers.AddRange(suppressors.Where(suppressor => !suppressorsInAnalysisScope.Contains(suppressor)));
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
279var attributes = symbol.GetAttributes().Where(a => IsSuppressionAttribute(a)); 315var attributes = symbol.GetAttributes().Where(a => IsSuppressionAttribute(a));
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray();
Operations\ControlFlowGraphBuilder.cs (1)
7957.Where(m => m.Kind == SymbolKind.Property)
SourceGeneration\RunResults.cs (2)
51ImmutableInterlocked.InterlockedInitialize(ref _lazyDiagnostics, Results.Where(r => !r.Diagnostics.IsDefaultOrEmpty).SelectMany(r => r.Diagnostics).ToImmutableArray()); 69ImmutableInterlocked.InterlockedInitialize(ref _lazyGeneratedTrees, Results.Where(r => !r.GeneratedSources.IsDefaultOrEmpty).SelectMany(r => r.GeneratedSources.Select(g => g.SyntaxTree)).ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (2)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray();
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
145.Where(m => m.Kind != SymbolKind.Method);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
190declaration = await SelectFirstOrDefaultAsync(declarations.Where(r => r.SyntaxTree == location.SourceTree), node => true, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker_Patterns.cs (1)
901var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Symbols\NamedTypeSymbol.cs (1)
696return GetMembersUnordered().Where(IsInstanceFieldOrEvent);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1781IEnumerable<Symbol> result = membersAndInitializers.NonTypeMembers.Where(IsInstanceFieldOrEvent);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
879uniqueUsings.AddAll(globalUsingNamespacesOrTypes.Where(n => n.UsingDirectiveReference?.SyntaxTree != tree).Select(n => n.NamespaceOrType));
Symbols\Source\SourcePropertySymbolBase.cs (1)
1674=> GetAttributes().Where(a => a.IsTargetAttribute(attributeDescription)).Cast<SourceAttributeData>().ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
611.Where(result => !result.IsInherited)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
225var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (3)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 62typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
448var constructors = type.InstanceConstructors.Where(m => m.Parameters.Length > index);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
1197Where((res) => res.Properties.EmbedInteropTypes). 1204Where((res) => res.Properties.EmbedInteropTypes). 1275Where((res) => !res.Properties.EmbedInteropTypes). 1282Where((res) => !res.Properties.EmbedInteropTypes).
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
327Assert.Empty(result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error));
SymbolKey\SymbolKeyCompilationsTests.cs (2)
229var indexer1 = type.GetMembers().Where(m => m.MetadataName == "I.Item").Single() as IPropertySymbol; 230var indexer2 = type.GetMembers().Where(m => m.MetadataName == "I<T>.Item").Single() as IPropertySymbol;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\CSharpPDBTestBase.cs (1)
28compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
PDB\PDBUsingTests.cs (1)
1488compilation.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
Attributes\AttributeTests_Assembly.cs (1)
1023.Where(a => string.Equals(a.AttributeClass.Name, attrTypeName, StringComparison.Ordinal));
Attributes\AttributeTests_Conditional.cs (1)
211Where(a => a.AttributeClass.Name != "CompilerGeneratedAttribute").
Attributes\AttributeTests_Dynamic.cs (1)
521var synthesizedDynamicAttributes = attributes.Where((attr) => string.Equals(attr.AttributeClass.Name, "DynamicAttribute", StringComparison.Ordinal));
Attributes\AttributeTests_Tuples.cs (1)
618var synthesizedTupleElementNamesAttr = attributes.Where(attr => string.Equals(attr.AttributeClass.Name, "TupleElementNamesAttribute", StringComparison.Ordinal));
Diagnostics\GetDiagnosticsTests.cs (1)
842var group1 = semanticDiagnostics.Where(d => d.Id == "ID0001");
FlowAnalysis\FlowDiagnosticTests.cs (7)
496Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 514Assert.Empty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 535Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 552Assert.Empty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 573Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 591Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 636Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error));
Semantics\PatternMatchingTests.cs (1)
5650compilation.GetEmitDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Warning).Verify(
Microsoft.CodeAnalysis.CSharp.Features (4)
AddImport\CSharpAddImportFeatureService.cs (1)
570aliases = metadataReference.Properties.Aliases.Where(a => a != MetadataReferenceProperties.GlobalAlias).ToImmutableArray();
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
137var tupleTypes = inferredTypes.Where(t => t.IsTupleType).OfType<INamedTypeSymbol>().ToList();
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
611.Where(result => !result.IsInherited)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
225var parameter = method.Parameters.Where(p => p.Name == identifier.Text).FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\BindingTests.cs (6)
3399Assert.False(symbols.Where(s => s.Name == "MathMin").Any()); 3400Assert.True(symbols.Where(s => s.Name == "MathMax").Any()); 3401Assert.True(symbols.Where(s => s.Name == "F1").Any()); 3402Assert.False(symbols.Where(s => s.Name == "F2").Any()); 3403Assert.False(symbols.Where(s => s.Name == "MathMax2").Any()); 3404Assert.False(symbols.Where(s => s.Name == "MathMax3").Any());
Semantics\ImportsTests.cs (1)
147comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\InteractiveUsingTests.cs (5)
142CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 161CreateCompilation(source, options: options).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 179CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 251CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 270CreateCompilation(source, options: options).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
Semantics\OperatorTests.cs (2)
6272CreateCompilation(text).GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 6293CreateCompilation(text).GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\TopLevelStatementsTests.cs (2)
326Assert.Empty(model1.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name)); 505Assert.Empty(model2.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name));
Semantics\VarianceTests.cs (2)
114var errors = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error); 227var errors = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (11)
Compilation\SemanticModelAPITests.cs (1)
4366compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (4)
1386var test = symbolsInC.Where(s => s.ContainingAssembly == null).ToList(); 1387Assert.Equal(9, symbolsInC.Where(s => s.ContainingType == null || s.ContainingType.SpecialType != SpecialType.System_Object).Count()); 1633var symbols = model.LookupSymbols(position).Where(s => !s.IsStatic && !((s is ITypeSymbol))); 1636var symbols2 = model.LookupSymbols(position, container: symbolC).Where(s => !s.IsStatic && !((s is ITypeSymbol)));
Compilation\UsedAssembliesTests.cs (2)
105Assert.Empty(used.Where(r => r.Properties.Kind == MetadataImageKind.Module)); 329Assert.Empty(used.Where(r => r.Properties.Kind == MetadataImageKind.Module));
SymbolDisplay\SymbolDisplayTests.cs (2)
5690var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 5894var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single();
Symbols\ExtensionMethodTests.cs (2)
3919Assert.Empty(model.LookupSymbols(instance.Position, baseClass, includeReducedExtensionMethods: true).Where(s => s.Name == "SetMembers")); 4014Assert.Empty(model.LookupSymbols(instance.Position, baseClass, includeReducedExtensionMethods: true).Where(s => s.Name == "SetMembers"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\LambdaUtilitiesTests.cs (1)
44compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CSharpTestBase.cs (4)
1375comp2.GetEmitDiagnostics().Where(d => shouldCompare(d)).Verify( 1376emitDiagnostics.Where(d => shouldCompare(d)). 2124var actualDiagnostics = compilation.GetDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Hidden); 2135var actualDiagnostics = compilation.GetDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Hidden);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (7)
Metadata\WinMdEventTests.cs (1)
2747var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single();
Metadata\WinMdMetadataTests.cs (6)
46var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single(); 68var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single(); 89var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single(); 109var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single(); 129var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single(); 171var winmdlib = comp.ExternalReferences.Where(r => r.Display == "Windows").Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Rename\CSharpRenameRewriterLanguageService.cs (2)
917.Where(t => t.Name == renamedSymbol.Name) 1048.Where(sym => !sym.Equals(renamedSymbol));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (3)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 62typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
448var constructors = type.InstanceConstructors.Where(m => m.Parameters.Length > index);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
MetadataAsSource\AbstractMetadataAsSourceTests.cs (1)
113Assert.False(generatedSymbol.Locations.Where(loc => loc.IsInSource).IsEmpty());
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
213.Where(member => member.MetadataName == memberSymbolName)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\DefinitionPeekableItem.cs (1)
83var sourceLocations = symbol.Locations.Where(l => l.IsInSource).ToList();
Microsoft.CodeAnalysis.Features (21)
ChangeSignature\SignatureChange.cs (2)
107var originalListWithoutRemovedOrAdded = originalListOfParameters.Where(updatedListOfParameters.Contains).ToImmutableArray(); 108var updatedListWithoutRemovedOrAdded = updatedListOfParameters.Where(originalListOfParameters.Contains).ToImmutableArray();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (1)
34foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && !d.IsSuppressed))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
43foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && d.IsSuppressed)) 89foreach (var diagnostic in diagnostics.Where(d => !d.Location.IsInSource && d.IsSuppressed))
Completion\CompletionService.ProviderManager.cs (3)
196return providers.Where(p => !p.IsSnippetProvider).ToImmutableArray(); 206return providers.Where(p => p.IsSnippetProvider).ToImmutableArray(); 210return providers.Where(p => !p.IsSnippetProvider).ToImmutableArray();
Completion\Providers\AbstractDocCommentCompletionProvider.cs (1)
119.Where(x => x.elementName == tagName && !existingAttributes.Contains(x.attributeName))
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
42.Where(expr => IsStringConcat(syntaxFacts, expr, semanticModel, cancellationToken))
ExtractInterface\AbstractExtractInterfaceService.cs (1)
103var extractableMembers = typeToExtractFrom.GetMembers().Where(IsExtractableMember);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
138using var _1 = GetPooledHashSet(priorityDocuments.Where(d => project == d.Project), out var highPriDocs);
Navigation\NavigableItemFactory.cs (1)
64: locations.Where(loc => loc.IsInSource);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
204symbols = symbols.Where(IsOk)
Snippets\SnippetFunctionService.cs (1)
64var enumFields = typeSymbol.GetMembers().Where(m => m.Kind == SymbolKind.Field && m.IsStatic);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
145.Where(m => m.Kind != SymbolKind.Method);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray();
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (1)
113.Where(m => MatchTypeArguments(m.TypeArguments, methodTypeArguments))
StackTraceExplorer\StackFrameLocalMethodResolver.cs (1)
39.Where(member => member.Name == containingMethodName)
ValueTracking\ValueTracker.OperationCollector.cs (1)
184.Where(ShouldTrackArgument)
Microsoft.CodeAnalysis.Features.UnitTests (4)
FindUsages\DefinitionItemFactoryTests.cs (4)
935Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1340Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1400Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1515Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.Service.cs (1)
558metadataReferencePaths.AddRange(resolvedReferences.Where(r => r.FilePath != null).Select(r => r.FilePath!));
Microsoft.CodeAnalysis.LanguageServer.Protocol (12)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (2)
92.Where(s => DocumentAnalysisExecutor.IsAnalyzerEnabledForProject(s.Analyzer, document.Project, owner.GlobalOptions)) 409builder.AddRange(diagnostics.Where(ShouldInclude));
Handler\CodeActions\CodeActionHelpers.cs (1)
433var matchingActions = currentActions.Where(action => action.Title == title);
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
229var textChangesBefore = textChanges.Where(t => t.Span.End <= originalSpan.Start);
Handler\SemanticTokens\SemanticTokensSchema.cs (2)
62.Where(classificationTypeName => !ClassificationTypeNames.AdditiveTypeNames.Contains(classificationTypeName)) 73.Where(classificationTypeName => !ClassificationTypeNames.AdditiveTypeNames.Contains(classificationTypeName))
LspServices\LspServices.cs (4)
45foreach (var lazyServiceFactory in mefLspServiceFactories.Where(f => f.Metadata.ServerKind == serverKind)) 49foreach (var lazyService in mefLspServices.Where(s => s.Metadata.ServerKind == serverKind)) 53foreach (var lazyServiceFactory in mefLspServiceFactories.Where(f => f.Metadata.ServerKind == WellKnownLspServerKinds.Any)) 57foreach (var lazyService in mefLspServices.Where(s => s.Metadata.ServerKind == WellKnownLspServerKinds.Any))
Workspaces\LspWorkspaceManager.cs (2)
333.Where(workspace => workspace.Kind != WorkspaceKind.MiscellaneousFiles) 334.Concat(registeredWorkspaces.Where(workspace => workspace.Kind == WorkspaceKind.MiscellaneousFiles))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
SemanticTokens\SemanticTokensRangeTests.cs (1)
586var expectedNames = ClassificationTypeNames.AllTypeNames.Where(s => !ClassificationTypeNames.AdditiveTypeNames.Contains(s));
Microsoft.CodeAnalysis.Rebuild (2)
MetadataCompilationOptions.cs (2)
39var optionValues = _options.Where(pair => pair.optionName == optionName).ToArray(); 51var optionValues = _options.Where(pair => pair.optionName == optionName).ToArray();
Microsoft.CodeAnalysis.Scripting (2)
Script.cs (2)
367return ImmutableArray.CreateRange(GetCompilation().GetDiagnostics(cancellationToken).Where(d => d.Severity == DiagnosticSeverity.Warning)); 371return ImmutableArray.CreateRange(e.Diagnostics.Where(d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning));
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
98var expectedSyntaxKinds = AllSyntaxKinds.Where(IsAnalyzeNodeSupported);
TargetFrameworkUtil.cs (1)
400.Where(x => !(x is PortableExecutableReference pe && excludeReferenceNames.Contains(pe.FilePath)));
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\QueryExpressions_FlowAnalysis.vb (1)
365Dim ss = dataFlowAnalysisResults.WrittenOutside.Where(Function(s) s.Name.Equals("s1", StringComparison.OrdinalIgnoreCase))
Microsoft.CodeAnalysis.Workspaces (16)
Diagnostics\HostDiagnosticAnalyzers.cs (1)
293current = current.Add(referenceIdentity, analyzers.Where(seen.Add).ToImmutableArray());
Editing\SyntaxGenerator.cs (4)
768members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 776members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 782members: type.GetMembers().Where(CanBeDeclared).Select(Declaration)), 789members: type.GetMembers().Where(s => s.Kind == SymbolKind.Field).Select(Declaration)),
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
286foreach (var attr in assembly.GetAttributes().Where(IsInternalsVisibleToAttribute))
FindSymbols\SymbolFinder_Callers.cs (1)
46var directReference = references.Where(
Log\AggregateLogger.cs (1)
102var set = aggregateLogger._loggers.Where(l => !predicate(l)).ToSet();
Recommendations\AbstractRecommendationServiceRunner.cs (1)
531: symbols.Where(s => s is not IFieldSymbol).Concat(namedType.TupleElements).ToImmutableArray();
Rename\ConflictEngine\ConflictResolver.cs (3)
101var renameSymbolDeclarationLocation = renameLocations.Symbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault(); 243.Where(s => !s.Equals(renamedSymbol) && 278.Where(s => !s.Equals(renamedSymbol) &&
Rename\RenameUtilities.cs (1)
91var documentsOfRenameSymbolDeclaration = symbol.Locations.Where(l => l.IsInSource).Select(l => solution.GetRequiredDocument(l.SourceTree!));
Shared\Extensions\ISymbolExtensions.cs (1)
479return baseType.Constructors.Where(c => IsSameSignature(methodSymbol, c)).FirstOrDefault();
Shared\Extensions\ITypeSymbolExtensions.cs (1)
87var constructedInterfaces = typeSymbol.AllInterfaces.Where(i =>
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
190declaration = await SelectFirstOrDefaultAsync(declarations.Where(r => r.SyntaxTree == location.SourceTree), node => true, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (1)
509Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));
VisualStudioMSBuildWorkspaceTests.cs (5)
375.Where(d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning) 1135private readonly IEnumerable<Assembly> _defaultAssembliesWithoutCSharp = MefHostServices.DefaultAssemblies.Where(a => !a.FullName.Contains("CSharp")); 2308var errs = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error); 2413comp.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify(); 2430comp.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify();
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\MembersMustExistAnalyzer.cs (1)
48var additionalAnalyzerFiles = context.Options.AdditionalFiles.Where(af => af.Path.IndexOf(s_analyzerName, 0, StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.DotNet.SignTool (2)
src\BatchSignUtil.cs (2)
101foreach (var fileSignInfo in _batchData.FilesToSign.Where(x => x.IsPEFile())) 119var toRepackSet = _batchData.FilesToSign.Where(x => x.ShouldRepack)?.Select(x => x.FullPath)?.ToHashSet();
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
687.Where(ic => ic.DeclaringSyntaxReferences
Microsoft.Extensions.Options.SourceGeneration (5)
Parser.cs (5)
201.Where(m => m.Kind == SymbolKind.Method) 286var baseMembers = baseType.GetMembers().Where(m => !addedMembers.Contains(m.Name)); 350foreach (var attribute in member.GetAttributes().Where(a => a.AttributeClass is not null)) 373if (transValidatorType.Constructors.Where(c => !c.Parameters.Any()).Any()) 436if (enumerationValidatorType.Constructors.Where(c => c.Parameters.Length == 0).Any())
Microsoft.Gen.Logging (4)
Parsing\Parser.cs (1)
709.Where(ic => ic.DeclaringSyntaxReferences
Parsing\Parser.LogProperties.cs (1)
123foreach (var property in members.Where(m => m.Kind == SymbolKind.Property).Cast<IPropertySymbol>())
Parsing\Parser.TagProvider.cs (1)
88var methodSymbols = providerType.GetMembers(providerMethodName).Where(m => m.Kind == SymbolKind.Method).Cast<IMethodSymbol>();
Parsing\TypeSymbolExtensions.cs (1)
82if (current.GetMembers("ToString").Where(m => m.Kind == SymbolKind.Method && m.DeclaredAccessibility == Accessibility.Public).Cast<IMethodSymbol>().Any(m => m.Parameters.Length == 0))
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
32List<Diagnostic> fixedDiagnostics = new(context.Diagnostics.Where(IsRequiresDiableRuntimeMarshallingDiagnostic));
Microsoft.Interop.SourceGeneration (2)
ManualTypeMarshallingHelper.cs (1)
155var attrs = entryPointType.GetAttributes().Where(attr => attr.AttributeClass.ToDisplayString() == TypeNames.CustomMarshallerAttribute).ToArray();
SignatureContext.cs (1)
32public IEnumerable<TypePositionInfo> ManagedParameters => ElementTypeInformation.Where(tpi => !TypePositionInfo.IsSpecialIndex(tpi.ManagedIndex));
Microsoft.ML.AutoML.SourceGenerator (10)
EstimatorTypeGenerator.cs (3)
25if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text) 35var trainers = context.AdditionalFiles.Where(f => f.Path.Contains("trainer-estimators.json")) 40var transformers = context.AdditionalFiles.Where(f => f.Path.Contains("transformer-estimators.json"))
SearchSpaceGenerator.cs (2)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text) 32var searchSpacesJson = context.AdditionalFiles.Where(f => f.Path.Contains("search_space.json"))
SweepableEstimatorFactoryGenerator.cs (3)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text) 32var trainers = context.AdditionalFiles.Where(f => f.Path.Contains("trainer-estimators.json")) 37var transformers = context.AdditionalFiles.Where(f => f.Path.Contains("transformer-estimators.json"))
SweepableEstimatorGenerator.cs (2)
21if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text) 31var estimators = context.AdditionalFiles.Where(f => f.Path.Contains("trainer-estimators.json") || f.Path.Contains("transformer-estimators.json"))
Microsoft.ML.Benchmarks.Tests (2)
BenchmarksTest.cs (2)
63string.Join(", ", summary.Reports.Where(r => !r.BuildResult.IsBuildSuccess).Select(r => r.BenchmarkCase.DisplayInfo))); 67string.Join(", ", summary.Reports.Where(r => r.ExecuteResults == null).Select(r => r.BenchmarkCase.DisplayInfo)));
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
139foreach (IFieldSymbol s in type.GetMembers().Where(p => p.Kind == SymbolKind.Field))
Microsoft.VisualStudio.LanguageServices (10)
ColorSchemes\ColorSchemeApplier.ClassificationVerifier.cs (1)
82.Where(color => color.Foreground.HasValue)
CommonControls\MemberSelectionViewModel.cs (2)
136Where(memberSymbolView => memberSymbolView.IsChecked && memberSymbolView.IsCheckable). 163foreach (var member in members.Where(viewModel => viewModel.IsCheckable))
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
85var includedMembers = viewModel.MemberContainers.Where(c => c.IsChecked).Select(c => c.Symbol);
Progression\GraphBuilder.cs (1)
215preferredLocation = newSymbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault();
TaskList\ProjectExternalErrorReporter.cs (1)
134.Where(f => f.ProjectId == _projectId)
Venus\ContainedLanguageCodeSupport.cs (3)
66var typeNode = type.DeclaringSyntaxReferences.Where(r => r.SyntaxTree == tree).Select(r => r.GetSyntax(cancellationToken)).First(); 303var members = allMembers.Where(m => IncludeMember(m, codeMemberType, compilation)); 465var members = type.GetMembers(memberName).Where(m => m.Kind == SymbolKind.Method);
Workspace\VisualStudioSymbolNavigationService.cs (1)
60var sourceLocations = symbol.Locations.Where(loc => loc.IsInSource);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
301Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
Roslyn.Test.PdbUtilities (2)
EditAndContinue\EditAndContinueTest.cs (1)
102diff.EmitResult.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error).Verify(expectedErrors);
Reader\PdbValidation.cs (1)
536result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Roslyn.VisualStudio.Next.UnitTests (3)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (3)
165analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType).ToImmutableArray(), 199var analyzers = analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType).ToImmutableArray(); 236analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType).ToImmutableArray(),
SemanticSearch.BuildTask.UnitTests (3)
GenerateFilteredReferenceAssembliesTaskTests.cs (3)
130c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 178c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 227c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
117=> type.Constructors.Where(ctor => !ctor.IsStatic && !(ctor.IsImplicitlyDeclared && type.IsValueType && ctor.Parameters.Length == 0));
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
166.Where(arg => arg.Parameter?.Name is not (UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName or UpgradeToGeneratedRegexAnalyzer.PatternArgumentName))
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
73Assert.Empty(emitResult.Diagnostics.Where(x => x.Severity == DiagnosticSeverity.Error));