244 references to GroupBy
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
134var slowestFiles = documentPerformance.OrderBy(pair => pair.Value.EditsPerSecond).GroupBy(pair => pair.Key.ProjectId); 158foreach (var group in allDiagnostics.GroupBy(diagnostic => diagnostic.Id).OrderBy(diagnosticGroup => diagnosticGroup.Key, StringComparer.OrdinalIgnoreCase))
aspire (3)
Commands\AddCommand.cs (1)
303.GroupBy(p => p.Channel)
Commands\NewCommand.cs (1)
194.GroupBy(cp => cp.Channel)
Projects\ProjectUpdater.cs (1)
43.GroupBy(step => step.ProjectFile.FullName)
Aspire.Confluent.Kafka.Tests (1)
OtelMetricsTests.cs (1)
114.GroupBy(x => x.Name).ToArray();
Aspire.Dashboard (1)
Model\Otlp\SpanWaterfallViewModel.cs (1)
123var groupedLogs = logs.GroupBy(l => l.SpanId).ToDictionary(l => l.Key, g => g.ToList());
Aspire.Dashboard.Components.Tests (1)
Controls\StructuredLogDetailsTests.cs (1)
68var duplicate = properties.GroupBy(p => p.Key).Where(g => g.Count() >= 2).FirstOrDefault();
Aspire.Hosting (2)
Dcp\DcpExecutor.cs (1)
1184foreach (var group in executables.GroupBy(e => e.ModelResource))
ProjectResourceBuilderExtensions.cs (1)
359.GroupBy(entry => entry.BindingAddress.Scheme);
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
249foreach (var g in roleAssignments.GroupBy(r => r.Target))
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
314var endpointsByTargetPort = endpoints.GroupBy(e => e.TargetPort)
CodeGenerator (7)
src\Servers\Kestrel\shared\KnownHeaders.cs (7)
446var groups = values.GroupBy(header => header.EqualIgnoreCaseBytesFirstTerm()) 791HeadersByLength = requestHeaders.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 798HeadersByLength = responseHeaders.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 805HeadersByLength = responseTrailers.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 1324{AppendSwitch(loop.Headers.GroupBy(x => x.Name.Length).OrderBy(x => x.Key))} 1503var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g => 1524var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g =>
GenerateDocumentationAndConfigFiles (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
IdeBenchmarks (1)
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
132foreach (var grouping in items.GroupBy(i => i.LineNumber))
IdeCoreBenchmarks (1)
NavigateToBenchmarks.cs (1)
214var searchTasks = solution.Projects.GroupBy(p => p.Services.GetService<INavigateToSearchService>()).Select(
InMemory.FunctionalTests (3)
ConnectionLimitTests.cs (1)
156.GroupBy(m =>
Http2\Http2TestBase.cs (1)
984.GroupBy(g => g.Key)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.GroupBy(g => g.Key)
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
118.GroupBy(r => r.Repo)
IOperationGenerator (2)
IOperationClassWriter.cs (2)
103foreach (var grouping in _tree.Types.OfType<AbstractNode>().GroupBy(n => n.Namespace)) 316.GroupBy(e => e.entry.Value)
Microsoft.AspNetCore.App.Analyzers (2)
Mvc\DetectAmbiguousActionRoutes.cs (1)
36.GroupBy(ar => new ActionRouteGroupKey(ar.ActionSymbol, ar.RouteUsageModel.RoutePattern, ar.HttpMethods, controllerHasActionToken, wellKnownTypes));
RouteHandlers\DetectAmbiguousRoutes.cs (1)
32.GroupBy(u => new MapOperationGroupKey(u.MapOperation.Builder, u.ResolvedOperation!, u.MapOperation.RouteUsageModel.RoutePattern, u.MapOperation.RouteUsageModel.UsageContext.HttpMethods));
Microsoft.AspNetCore.Components.Tests (2)
Routing\RouteTableFactoryTests.cs (2)
75Assert.Equal(routes.GroupBy(x => x.Handler).Count(), routes.Count); 1142.GroupBy(rt => rt.Handler)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\EnumNameHelpers.cs (1)
96foreach (var item in nameMappings.GroupBy(m => m.RemoveEnumPrefixName).Select(g => KeyValuePair.Create(g.Key, g.First().OriginalName)))
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (1)
32.GroupBy(actionDesc => actionDesc.RouteValues["controller"]!)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiDescriptionGroupCollectionProvider.cs (1)
78.GroupBy(d => d.GroupName)
Microsoft.AspNetCore.OpenApi (2)
Services\OpenApiDocumentService.cs (2)
248.GroupBy(apiDescription => apiDescription.MapRelativePathToItemPath()); 587var groupedFormParameters = formParameters.GroupBy(parameter => parameter.ParameterDescriptor.Name);
Microsoft.AspNetCore.Routing (3)
Matching\ILEmitTrieFactory.cs (3)
106var groups = entries.GroupBy(e => e.text.Length).ToArray(); 331var groups = entries.GroupBy(e => GetUInt64Key(e.text, index)).ToArray(); 449var groups = entries.GroupBy(e => GetUInt16Key(e.text, index)).ToArray();
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
35.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText))
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
42.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText))
Microsoft.AspNetCore.Routing.Tests (5)
Matching\DfaMatcherBuilderTest.cs (3)
3605.GroupBy(e => e.Metadata.GetMetadata<TestMetadata1>().State) 3647.GroupBy(e => e.Metadata.GetMetadata<TestMetadata2>().State) 3672.GroupBy(e => e.Metadata.GetMetadata<TestMetadata1>().State)
Matching\RouteMatcherBuilder.cs (1)
35.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText))
Matching\TreeRouterMatcherBuilder.cs (1)
42.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (8)
Http2\Http2HPackEncoderTests.cs (1)
663.GroupBy(k => k.Key)
src\Servers\Kestrel\shared\KnownHeaders.cs (7)
446var groups = values.GroupBy(header => header.EqualIgnoreCaseBytesFirstTerm()) 791HeadersByLength = requestHeaders.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 798HeadersByLength = responseHeaders.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 805HeadersByLength = responseTrailers.OrderBy(x => x.Name.Length).GroupBy(x => x.Name.Length), 1324{AppendSwitch(loop.Headers.GroupBy(x => x.Name.Length).OrderBy(x => x.Key))} 1503var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g => 1524var groupedHeaders = staticHeaders.GroupBy(h => Encoding.ASCII.GetString(h.HeaderField.Name)).Select(g =>
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.GroupBy(g => g.Key)
Microsoft.Build.Framework (1)
BuildCheck\BuildCheckTracingData.cs (1)
41.GroupBy(d => d.Value.CheckFriendlyName)
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
82var groupedItems = MetadataItems.GroupBy(i => NormalizeWithForwardSlash(i.GetMetadata("FullPath")));
Microsoft.Build.Tasks.CodeAnalysis.Sdk (1)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
82var groupedItems = MetadataItems.GroupBy(i => NormalizeWithForwardSlash(i.GetMetadata("FullPath")));
Microsoft.Cci.Extensions (1)
Mappings\AttributesMapping.cs (1)
43var attrGroups = attributes.GroupBy(c => c.Constructor.DocId());
Microsoft.CodeAnalysis (7)
CommandLine\ReportAnalyzerUtil.cs (2)
82.GroupBy(kvp => kvp.Key.GetType().Assembly) 128.GroupBy(t => t.Generator.GetGeneratorType().Assembly)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
342foreach (var diagsByKey in diagnostics.GroupBy(getKeyFunc))
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
1454var actionsByAnalyzers = analyzerActions.SymbolActions.GroupBy(action => action.Analyzer); 1486var actionsByAnalyzers = analyzerActions.GroupBy(action => action.Analyzer); 1830foreach (var groupedActions in symbolEndActions.GroupBy(a => a.Analyzer))
SourceGeneration\GeneratorDriver.cs (1)
33Debug.Assert(state.Generators.GroupBy(s => s.GetGeneratorType()).Count() == state.Generators.Length); // ensure we don't have duplicate generator types
Microsoft.CodeAnalysis.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
SymbolIsBannedAnalyzer.cs (1)
84var groups = entries.GroupBy(e => TrimForErrorReporting(e.DeclarationId));
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (2)
43var groups = options.GroupBy(o => o.IsPerLanguage); 57var languageGroups = group.GroupBy(o => ((ISingleValuedOption)o).LanguageName);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
683foreach (var group in documentationComments.GroupBy(d => d.SyntaxTree))
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
59var declaratorsByField = declarators.GroupBy(g => g.FirstAncestorOrSelf<TFieldDeclarationSyntax>()!);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
159var groupedLocations = locations.GroupBy(loc => loc.Document);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
78.GroupBy(diagnostic => diagnostic.Location.SourceTree)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
269return diagnostics.GroupBy(d => syntaxFacts.GetContainingMemberDeclaration(root, d.Location.SourceSpan.Start) ?? root);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
61declarationReferences.GroupBy(reference => solution.GetDocumentId(reference.SyntaxTree)!))
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
290foreach (var group in fieldLocations.SelectMany(loc => loc.Locations).GroupBy(loc => loc.Document)) 460foreach (var group in referencedSymbols.SelectMany(r => r.Locations).GroupBy(loc => loc.Document))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
Microsoft.CodeAnalysis.CSharp (5)
BoundTree\LengthBasedStringSwitchData.cs (2)
154foreach (var group in inputCases.Where(c => !c.value.IsNull).GroupBy(c => c.value.StringValue!.Length)) 187foreach (var group in casesWithGivenLength.GroupBy(c => c.value[bestCharacterPosition]))
BoundTree\UnboundLambda.cs (1)
1271IEnumerable<KeyValuePair<T, BoundLambda>> minDiagnosticsGroup = candidates.GroupBy(lambda => lambda.Value.Diagnostics.Diagnostics.Length).OrderBy(group => group.Key).First();
Symbols\Source\ConstantEvaluationHelpers.cs (1)
276fieldsInvolvedInCycles.AddRange(graph.Keys.GroupBy(static f => f.DeclaringCompilation).
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2418IEnumerable<IGrouping<string, NamedTypeSymbol>> extensionsByReceiverType = GetTypeMembers("").Where(static t => t.IsExtension).GroupBy(static t => ((SourceNamedTypeSymbol)t).ExtensionGroupingName);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
435foreach (var group in orderedParameterAssignments.GroupBy(t => t.parameter))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
105foreach (var group in containersAndLocations.GroupBy(t => t.container))
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
60foreach (var (token, directives) in nullableDirectives.GroupBy(d => d.ParentTrivia.Token))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
533foreach (var group in removedMembers.Values.GroupBy(n => n.memberNode.SyntaxTree)) 606foreach (var group in nodesToReplace.GroupBy(n => n.SyntaxTree)) 622foreach (var group in seeTagsToReplace.GroupBy(n => n.SyntaxTree))
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
124.GroupBy(loc => loc.Document);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
108var groups = references.SelectMany(static r => r.Locations.Where(loc => !loc.IsImplicit)).GroupBy(static loc => loc.Document);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenAsyncLocalsTests.cs (1)
975IEnumerable<IGrouping<TypeSymbol, FieldSymbol>> spillFieldsByType = stateMachineClass.GetMembers().Where(m => m.Kind == SymbolKind.Field && m.Name.StartsWith("<>7__wrap", StringComparison.Ordinal)).Cast<FieldSymbol>().GroupBy(x => x.Type);
Microsoft.CodeAnalysis.CSharp.Features (13)
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
241foreach (var group in symbols.GroupBy(s => s.Name))
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
128var operatorGroups = unnamedSymbols.WhereAsArray(s => s.IsUserDefinedOperator()).GroupBy(op => op.Name);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
236foreach (var grouping in initializers.GroupBy(kvp => kvp.Value.SyntaxTree)) 366foreach (var grouping in references.GroupBy(r => r.SyntaxTree))
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
59var referenceByDocument = implReferences.Locations.GroupBy(loc => loc.Document);
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
274foreach (var group in parameter.ContainingType.DeclaringSyntaxReferences.GroupBy(r => r.SyntaxTree))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
435foreach (var group in orderedParameterAssignments.GroupBy(t => t.parameter))
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
105foreach (var group in containersAndLocations.GroupBy(t => t.container))
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
60foreach (var (token, directives) in nullableDirectives.GroupBy(d => d.ParentTrivia.Token))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
533foreach (var group in removedMembers.Values.GroupBy(n => n.memberNode.SyntaxTree)) 606foreach (var group in nodesToReplace.GroupBy(n => n.SyntaxTree)) 622foreach (var group in seeTagsToReplace.GroupBy(n => n.SyntaxTree))
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
124.GroupBy(loc => loc.Document);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
464var annotationsByMethod = allAnnotations.GroupBy(annotation => annotation.Expression.Ancestors().OfType<BaseMethodDeclarationSyntax>().First()).ToArray();
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
108var groups = references.SelectMany(static r => r.Locations.Where(loc => !loc.IsImplicit)).GroupBy(static loc => loc.Document);
Microsoft.CodeAnalysis.EditorFeatures (4)
Copilot\CopilotWpfTextCreationListener.cs (1)
116foreach (var editGroup in proposal.Edits.GroupBy(e => e.Span.Snapshot))
Copilot\RoslynProposalAdjusterProvider.cs (1)
166foreach (var editGroup in proposal.Edits.GroupBy(e => e.Span.Snapshot))
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (1)
80.GroupBy(d => d.Id)
InlineRename\UI\Adornment\RenameFlyoutViewModel.cs (1)
402var fileCount = renameLocations.GroupBy(s => s.Document.FilePath).Count();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeActions\CodeChangeProviderMetadataTests.cs (1)
63var exportedProvidersByName = exportedProviders.GroupBy(
Microsoft.CodeAnalysis.Features (26)
AddImport\AbstractAddImportFeatureService.cs (1)
578.GroupBy(diagnostic => diagnostic.Location.SourceSpan)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
74foreach (var grouping in diagnosticsByDocument.GroupBy(d => d.Key.Project))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
135foreach (var removeSuppressionFixesForTree in attributeRemoveFixes.GroupBy(fix => fix.SyntaxTreeToModify))
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
113.GroupBy(change => change.Span)
CodeRefactorings\CodeRefactoringService.cs (1)
37.GroupBy(lz => new ProviderKey(lz.Metadata.Language, lz.Metadata.DocumentKind, lz.Metadata.DocumentExtension))
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
485var refLocationGroups = refLocationsInSolution.GroupBy(loc => loc.Document.Id);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
333foreach (var group in documentsToUpdate.GroupBy(d => d.Document.Project)) 531foreach (var group in declarationService.GetDeclarations(typeSymbol).GroupBy(r => r.SyntaxTree))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
47_analyzerProviders = analyzerProviders.GroupBy(kv => kv.Metadata.Name).ToImmutableDictionary(g => g.Key, g => g.ToImmutableArray());
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
65foreach (var group in priorityDocuments.GroupBy(d => d.Project))
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
226foreach (var group in nonLocalImports.GroupBy(i => i.DeclaringSyntaxReference?.SyntaxTree))
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
250source: methodCallSites.GroupBy(kvp => kvp.Key.Project),
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
118var groups = documentKeys.GroupBy(d => d.Project).ToImmutableArray();
NavigateTo\NavigateToSearcher.cs (1)
361var groups = projectGroup.GroupBy(GetNavigateToSearchService);
Options\EditorConfig\EditorConfigFileGenerator.cs (1)
62foreach (var optionGrouping in options.GroupBy(o => o.Definition.Group).OrderBy(g => g.Key.Priority))
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (2)
43var groups = options.GroupBy(o => o.IsPerLanguage); 57var languageGroups = group.GroupBy(o => ((ISingleValuedOption)o).LanguageName);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
683foreach (var group in documentationComments.GroupBy(d => d.SyntaxTree))
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
59var declaratorsByField = declarators.GroupBy(g => g.FirstAncestorOrSelf<TFieldDeclarationSyntax>()!);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
159var groupedLocations = locations.GroupBy(loc => loc.Document);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
78.GroupBy(diagnostic => diagnostic.Location.SourceTree)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
269return diagnostics.GroupBy(d => syntaxFacts.GetContainingMemberDeclaration(root, d.Location.SourceSpan.Start) ?? root);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
61declarationReferences.GroupBy(reference => solution.GetDocumentId(reference.SyntaxTree)!))
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
290foreach (var group in fieldLocations.SelectMany(loc => loc.Locations).GroupBy(loc => loc.Document)) 460foreach (var group in referencedSymbols.SelectMany(r => r.Locations).GroupBy(loc => loc.Document))
UnusedReferences\UnusedReferencesRemover.cs (1)
70var referencesByType = references.GroupBy(reference => reference.ReferenceType)
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
52.GroupBy(e => e.id)
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
393foreach (var group in actions.GroupBy(a => a.CodeActionPriority))
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (1)
115.GroupBy(m => m.MethodName))
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
101.GroupBy(m => m.MethodName))
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (2)
AnnotatePublicApiFix.cs (1)
126.GroupBy(d => d.Location.SourceTree);
DeclarePublicApiFix.cs (1)
257.GroupBy(d => d.Location.SourceTree);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (2)
109foreach (var typeGroup in documents.GroupBy(t => t.type)) 114foreach (var group in typeGroup.GroupBy(d => d.document.Id))
Microsoft.CodeAnalysis.UnitTests (1)
MetadataReferences\MetadataHelpersTests.cs (1)
451Assert.False(nestedNamespaces.GroupBy(pair => pair.Key).Where(g => g.Count() > 1).Any());
Microsoft.CodeAnalysis.Workspaces (18)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (2)
69foreach (var group in docIdToTextMerger.GroupBy(kvp => kvp.Key.ProjectId)) 207foreach (var group in allChangedDocumentsInDiagnosticsOrder.GroupBy(d => d.Id))
Diagnostics\Extensions.cs (1)
232foreach (var group in additionalPragmaSuppressionDiagnostics.GroupBy(d => d.Location.SourceTree!))
FindSymbols\ReferenceLocationExtensions.cs (2)
20var documentGroups = referenceLocations.GroupBy(loc => loc.Document); 21var projectGroups = documentGroups.GroupBy(g => g.Key.Project);
Log\StatisticResult.cs (1)
37var mode = values.GroupBy(i => i).OrderByDescending(g => g.Count()).First().Key;
ReassignedVariable\AbstractReassignedVariableService.cs (1)
198foreach (var group in containingType.DeclaringSyntaxReferences.GroupBy(r => r.SyntaxTree))
Rename\ConflictEngine\ConflictResolver.cs (1)
195foreach (var implicitReferenceLocationsPerLanguage in implicitReferenceLocations.GroupBy(loc => loc.Document.Project.Language))
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
101.GroupBy(d => d.ProjectId) 785.GroupBy(l => l.ContainingLocationForStringOrComment)
Rename\ConflictEngine\MutableConflictResolution.cs (1)
153var documentToRelatedLocationsMap = this.RelatedLocations.GroupBy(loc => loc.DocumentId).ToImmutableDictionary(
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
341foreach (var documentsGroupedByLanguage in RenameUtilities.GetDocumentsAffectedByRename(originalSymbol, solution, renameLocations).GroupBy(d => d.Project.Language))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
Workspace\Solution\SolutionCompilationState.cs (2)
838.GroupBy(static d => d.documentId.ProjectId) 1765documentInfos.GroupBy(d => d.Id.ProjectId).Select(g =>
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
283var groups = emitResult.Diagnostics.GroupBy(d => d.Id).Select(g => $"{g.Key}:{g.Count()}");
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Options\NamingStylePreferencesTests.cs (1)
199var duplicates = enumNamesAndValues.GroupBy(e => e.value)
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
AbstractLanguageServer.cs (1)
115.GroupBy(m => m.MethodName))
RequestExecutionQueue.cs (1)
101.GroupBy(m => m.MethodName))
Microsoft.DotNet.Baselines.Tasks (2)
PRCreator.cs (2)
145.GroupBy(updatedFile => ParseUpdatedFileName(updatedFile).Split('.')[0]) 320var groups = items.GroupBy(item => Path.GetDirectoryName(item.Path));
Microsoft.DotNet.Build.Tasks.Packaging (6)
CreateTrimDependencyGroups.cs (1)
73.GroupBy(dependency => dependency.TargetFramework)
GenerateRuntimeDependencies.cs (3)
89var runtimeGroups = Dependencies.GroupBy(d => d.GetMetadata("TargetRuntime")); 109var targetPackageGroups = runtimeGroup.GroupBy(d => GetTargetPackageId(d, packageAliases)); 115var dependencyGroups = targetPackageGroup.GroupBy(d => d.ItemSpec);
PromoteDependencies.cs (2)
44var refSets = dependencies.Where(d => d.Id != "_._").Where(d => d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 49var libSets = dependencies.Where(d => !d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray());
Microsoft.DotNet.GenFacades (1)
GenPartialFacadeSourceGenerator.cs (1)
42IEnumerable<string> duplicates = seedNames.GroupBy(x => x)
Microsoft.DotNet.SharedFramework.Sdk (1)
src\CreateFrameworkListFile.cs (1)
98.GroupBy(f => f.Item.ItemSpec)
Microsoft.DotNet.SourceBuild.Tasks (1)
src\WriteBuildOutputProps.cs (1)
62.GroupBy(identity => identity.Id)
Microsoft.Extensions.AI.Integration.Tests (1)
VerbatimMultiPartHttpHandler.cs (1)
193=> RemoveWhiteSpace(text)?.GroupBy(c => c)
Microsoft.Extensions.DependencyModel (2)
DependencyContextJsonReader.cs (1)
797foreach (IGrouping<string?, RuntimeTargetEntryStub> ridGroup in targetLibrary.RuntimeTargets.GroupBy(e => e.Rid))
DependencyContextWriter.cs (1)
424.GroupBy(library => library.Name + DependencyContextStrings.VersionSeparator + library.Version);
Microsoft.Extensions.Http.Resilience.Tests (1)
Helpers\OptionsUtilities.cs (1)
54.GroupBy(property => property.Name)
Microsoft.Extensions.Logging.AzureAppServices (2)
BlobLoggerProvider.cs (1)
57var eventGroups = messages.GroupBy(GetBlobKey);
FileLoggerProvider.cs (1)
43foreach (var group in messages.GroupBy(GetGrouping))
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
75foreach (IGrouping<SyntaxTree, ClassDeclarationSyntax> group in classes.GroupBy(x => x.SyntaxTree))
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
50foreach (var group in classes.GroupBy(x => x.TypeSyntax.SyntaxTree))
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree);
Microsoft.Gen.Logging (1)
Parsing\Parser.cs (1)
51foreach (var group in types.GroupBy(x => x.SyntaxTree))
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (1)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree);
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
68foreach (var typeDeclarationGroup in types.GroupBy(x => x.SyntaxTree))
Microsoft.Gen.Metrics (1)
Parser.cs (1)
68foreach (var typeDeclarationGroup in types.GroupBy(x => x.SyntaxTree))
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
68foreach (var typeDeclarationGroup in types.GroupBy(x => x.SyntaxTree))
Microsoft.Interop.ComInterfaceGenerator (2)
ComInterfaceGenerator.cs (1)
82return data.GroupBy(data => data.Left.GetTopLevelBase());
VtableIndexStubGenerator.cs (1)
123.SelectMany(static (data, ct) => data.GroupBy(stub => stub.ContainingSyntaxContext))
Microsoft.ML.AutoML (5)
AutoMLExperiment\AutoMLExperiment.cs (1)
224var mostRecentAddedStopServices = stopServices.GroupBy(s => s.GetType()).Select(g => g.Last()).ToList();
ColumnInference\TextFileContents.cs (1)
110var mostCommon = columnCounts.GroupBy(x => x).OrderByDescending(x => x.Count()).First();
PipelineSuggesters\PipelineSuggester.cs (2)
100history = history.GroupBy(r => r.Pipeline.Trainer.TrainerName).Select(g => g.First()); 115.GroupBy(h => h.Pipeline.Trainer.TrainerName)
Utils\UserInputValidationUtil.cs (1)
303var groups = values.GroupBy(v => v);
Microsoft.ML.Fairlearn (2)
Metrics\FairlearnMetricCatalog.cs (2)
93}).GroupBy(kv => kv.id) 186var groups = evalDf.Rows.GroupBy(r => r[sensitiveCol.Index]);
Microsoft.ML.Tests (4)
Scenarios\Api\TestApi.cs (4)
381var uniqueTrain = stratTrainWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 383var uniqueTest = stratTestWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 393var uniqueSeedTrain = stratTrainWithSeedWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 395var uniqueSeedTest = stratTestWithSeedWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList();
Microsoft.ML.Tokenizers (1)
Model\WordPieceTokenizer.cs (1)
45SpecialTokensReverse = options.SpecialTokens is not null ? options.SpecialTokens.GroupBy(kvp => kvp.Value).ToDictionary(g => g.Key, g => g.First().Key) : null;
Microsoft.VisualStudio.LanguageServices (6)
InheritanceMargin\InheritanceMarginHelpers.cs (1)
111.GroupBy(t => t.RelationToMember)
InheritanceMargin\InheritanceMarginTaggerProvider.cs (1)
110var lineToMembers = inheritanceMemberItems.GroupBy(item => item.LineNumber);
Preview\PreviewEngine.cs (1)
163var orderedChangedDocuments = changedDocuments.GroupBy(d => d.ProjectId).OrderByDescending(g => g.Count()).Flatten();
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
471foreach (var group in builder.GroupBy(kvp => kvp.Key.ProjectId)) 491foreach (var kvp in latestProjectDiagnostics.Where(d => d.DocumentId != null).GroupBy(d => d.DocumentId!))
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
195var groupedDiagnostics = diagnostics.GroupBy(d => d.DataLocation.UnmappedFileSpan.Path);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
208var optionsForSettings = dataSnapshot.GroupBy(s => s.Key.Option).Select(g => g.Key).ToArray();
Microsoft.VisualStudio.LanguageServices.Implementation (2)
SolutionExplorer\AnalyzersCommandHandler.cs (1)
273var groups = _tracker.SelectedDiagnosticItems.GroupBy(item => item.ProjectId);
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (1)
162.GroupBy(d => d.Id)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
167foreach (var group in Locations.GroupBy(l => l.Document))
PrepareTests (2)
MinimizeUtil.cs (2)
130.GroupBy(fp => getGroupDirectory(fp.FilePath.RelativeDirectory)); 168.GroupBy(v => getGroupDirectory(v.RelativeDirectory));
Roslyn.Diagnostics.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
108var groups = references.SelectMany(static r => r.Locations.Where(loc => !loc.IsImplicit)).GroupBy(static loc => loc.Document);
RunTests (1)
AssemblyScheduler.cs (1)
263var tests = deserialized.GroupBy(GetTypeName)
System.Linq (2)
System\Linq\AggregateBy.cs (2)
24/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey})"/> methods 68/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey})"/> methods
Text.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
140foreach (var (textDocument, diagnosticsForDocument) in diagnostics.GroupBy(d => solution.GetTextDocumentForLocation(d.Location)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (1)
165var nodesBySemanticBoundary = originalNodePairs.GroupBy(pair => getSemanticBoundary(syntaxFacts, pair.nodes.semanticNode));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
xunit.console (1)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (1)
391foreach (var ridGroup in targetLibrary.RuntimeTargets.GroupBy(e => e.Rid))