634 references to ToImmutableArray
AnalyzerRunner (3)
CodeRefactoringRunner.cs (2)
157pair => FilterRefactorings(pair.Value, options).ToImmutableArray()); 234language => refactorings.Where(refactoring => refactoring.Metadata.Languages.Contains(language)).ToImmutableArray());
DiagnosticAnalyzerRunner.cs (1)
236pair => FilterAnalyzers(pair.Value, options).ToImmutableArray());
Aspire.Dashboard (8)
Model\ResourceGraph\ResourceGraphMapper.cs (1)
63ReferencedNames = resolvedNames.Distinct().OrderBy(n => n).ToImmutableArray(),
ResourceService\DashboardClient.cs (1)
439InitialState: _resourceByName.Values.ToImmutableArray(),
ResourceService\Partials.cs (6)
41HealthReports = HealthReports.Select(ToHealthReportViewModel).OrderBy(vm => vm.Name).ToImmutableArray(), 71.ToImmutableArray(); 78.ToImmutableArray(); 97.ToImmutableArray(); 104.ToImmutableArray(); 111.ToImmutableArray();
Aspire.Dashboard.Components.Tests (9)
Controls\ResourceDetailsTests.cs (8)
31}.ToImmutableArray()); 78}.ToImmutableArray()); 115}.ToImmutableArray()); 162}.ToImmutableArray()); 199}.ToImmutableArray()); 246}.ToImmutableArray()); 283}.ToImmutableArray()); 330}.ToImmutableArray());
Shared\TestDashboardClient.cs (1)
80return Task.FromResult(new ResourceViewModelSubscription(_initialResources?.ToImmutableArray() ?? [], BuildSubscription(channel, cancellationToken)));
Aspire.Dashboard.Tests (1)
Model\ResourceViewModelTests.cs (1)
29var reports = healthStatusStrings?.Select<string?, HealthReportViewModel>((h, i) => new HealthReportViewModel(i.ToString(), h is null ? null : System.Enum.Parse<DiagnosticsHealthStatus>(h), null, null)).ToImmutableArray() ?? [];
Aspire.Hosting (3)
Dashboard\ResourcePublisher.cs (1)
55InitialState: _snapshot.Select(r => r.Value.Snapshot).ToImmutableArray(),
Dcp\ResourceSnapshotBuilder.cs (1)
232return container.Spec.VolumeMounts?.Select(v => new VolumeSnapshot(v.Source, v.Target ?? "", v.Type, v.IsReadOnly)).ToImmutableArray() ?? [];
Devcontainers\Codespaces\CodespacesResourceUrlRewriterService.cs (1)
62Urls = transformedUrls.ToImmutableArray()
Aspire.Hosting.Tests (1)
Health\HealthStatusTests.cs (1)
26var reports = healthStatusStrings?.Select<string?, HealthReportSnapshot>((h, i) => new HealthReportSnapshot(i.ToString(), h is null ? null : Enum.Parse<HealthStatus>(h), null, null)).ToImmutableArray() ?? [];
BuildValidator (4)
CompilationDiff.cs (3)
179var peReader = new PEReader(rebuildBytes.ToImmutableArray()); 264var originalPeReader = new PEReader(_originalPortableExecutableBytes.ToImmutableArray()); 265var rebuildPeReader = new PEReader(_rebuildPortableExecutableBytes.ToImmutableArray());
Program.cs (1)
376var sourceLinks = documents.Select(makeSourceLink).ToImmutableArray();
CodeStyleConfigFileGenerator (1)
Program.cs (1)
40var assemblyList = args[3].Split([';'], StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
GenerateDocumentationAndConfigFiles (2)
Program.cs (1)
966var releaseTrackingData = releaseTrackingFilesDataBuilder.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
IdeBenchmarks (1)
RegexClassifierBenchmarks.cs (1)
97return results.ToImmutableArray();
IdeCoreBenchmarks (3)
ClassificationBenchmarks.cs (1)
90return result.ToImmutableArray();
FormatterBenchmarks.cs (1)
71_ = formattedRoot.DescendantNodesAndSelf().ToImmutableArray();
NavigateToBenchmarks.cs (1)
231solution, grouping.ToImmutableArray(), priorityDocuments, "Syntax", service.KindsProvided, activeDocument: null,
illink (2)
ILLink.CodeFixProvider (5)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
64 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresAssemblyFilesCodeFixProvider.cs (1)
25 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresDynamicCodeCodeFixProvider.cs (1)
22 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresUnreferencedCodeCodeFixProvider.cs (1)
22 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
UnconditionalSuppressMessageCodeFixProvider.cs (1)
30 DiagnosticId.RequiresDynamicCode }).Select (d => d.AsString ()).ToImmutableArray ();
Metrics (7)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Metrics.Legacy (7)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
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.Analyzers (1)
StartupAnalysisBuilder.cs (1)
37v => v.Value.ToImmutableArray()));
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (1)
69ITypeSymbol typeSymbol => typeSymbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray().As<ISymbol>(),
Microsoft.AspNetCore.App.Analyzers.Test (2)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
216spans = builder.ToImmutableArray(); 223spans = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
XmlComments\XmlComment.InheritDoc.cs (1)
231var typeParameterRefs = document.Descendants(DocumentationCommentXmlNames.TypeParameterReferenceElementName).ToImmutableArray();
Microsoft.Build (4)
Definition\Project.cs (1)
2633ImmutableArray<string> includeGlobStrings = includeGlobFragments.Select(f => f.TextFragment).ToImmutableArray();
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
78.ToImmutableArray();
Globbing\CompositeGlob.cs (1)
32: this(globs.ToImmutableArray())
Graph\GraphBuilder.cs (1)
63var (actualEntryPoints, solutionDependencies) = ExpandSolutionIfPresent(entryPoints.ToImmutableArray());
Microsoft.CodeAnalysis (22)
Binding\BindingDiagnosticBag.cs (1)
85return new ReadOnlyBindingDiagnostic<TAssemblySymbol>(DiagnosticBag?.ToReadOnly(forceDiagnosticResolution) ?? default, DependenciesBag?.ToImmutableArray() ?? default);
CommandLine\CommonCompiler.cs (1)
244referenceDirectiveResolver = new ExistingReferencesResolver(commandLineReferenceResolver, resolved.ToImmutableArray());
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
51_additionalLocations = additionalLocations?.ToImmutableArray() ?? SpecializedCollections.EmptyReadOnlyList<Location>();
DiagnosticAnalyzer\AnalysisResultBuilder.cs (2)
544var diagnostics = diagnosticsByAnalyzer.Value.Where(shouldInclude).ToImmutableArray(); 574var diagnostics = diagnosticsByAnalyzer.Value.Where(shouldInclude).ToImmutableArray();
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
395return _resolvedToOriginalPathMap.Select(x => (x.Value, x.Key)).ToImmutableArray();
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
1475var actionsByKind = actionsByKindBuilder.Select(a => a.ToImmutableAndFree()).ToImmutableArray(); 1490builder.Add((analyzerAndActions.Key, analyzerAndActions.ToImmutableArray()));
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
423return builder.Distinct(ExtTypeComparer.Instance).ToImmutableArray();
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
827return _codeBlockStartActions.OfType<CodeBlockStartAnalyzerAction<TLanguageKindEnum>>().ToImmutableArray();
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
119candidateMembers.Where(s => s.Kind == SymbolKind.NamedType).ToImmutableArray() : 120candidateMembers.Where(s => s.Kind != SymbolKind.NamedType).ToImmutableArray();
DocumentationCommentId.cs (2)
114return results.ToImmutableArray(); 192return results.ToImmutableArray();
Emit\CommonPEModuleBuilder.cs (1)
1061builder.Add(entry.Key, entry.Value.ToImmutableArray<ISymbolInternal>());
Operations\ControlFlowGraphBuilder.Context.cs (1)
37_currentImplicitInstance.AnonymousTypePropertyValues?.ToImmutableArray() ??
PEWriter\MetadataWriter.cs (1)
1912}).ToImmutableArray();
SourceGeneration\Nodes\NodeStateTable.cs (1)
651return new TableEntry(OneOrMany.Create(itemBuilder.ToImmutableArray()), s_allCachedEntries, anyRemoved: false);
SourceGeneration\Nodes\SharedInputNodes.cs (1)
24public static readonly InputNode<SyntaxTree> SyntaxTrees = new InputNode<SyntaxTree>(b => b.Compilation.SyntaxTrees.ToImmutableArray());
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());
Text\TextChangeEventArgs.cs (1)
33this.Changes = changes.ToImmutableArray();
Microsoft.CodeAnalysis.Analyzers (13)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
1085customTags = arrayInitializer.ElementValues.Select(element => (string)element.ConstantValue.Value!).ToImmutableArray();
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
66var projectIds = diagnosticsToFix.Select(d => d.Key.Id).ToImmutableArray();
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
45var additionalDocuments = context.Document.Project.AdditionalDocuments.ToImmutableArray();
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
105var additionalDocuments = project.AdditionalDocuments.ToImmutableArray();
MetaAnalyzers\SymbolIsBannedInAnalyzersAnalyzer.cs (1)
116return result.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
442.SelectMany(ExpandConstituentNamespaces).ToImmutableArray());
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Microsoft.CodeAnalysis.AnalyzerUtilities (14)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMapExtensions.cs (3)
70pointsToAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray())); 93arguments.Select(o => pointsToAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray(), 94arguments.Select(o => valueContentAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray()));
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocationDataFlowOperationVisitor.cs (1)
124var keys = currentAnalysisData.Keys.ToImmutableArray();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (1)
139var keys = CoreAnalysisData.Keys.ToImmutableArray();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (1)
94var keys = currentAnalysisData.Keys.ToImmutableArray();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (1)
302CreateAbstractIndices(propertyReference.Arguments.Select(a => a.Value).ToImmutableArray()) :
Microsoft.CodeAnalysis.BannedApiAnalyzers (9)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
SymbolIsBannedAnalyzer.cs (1)
129return result.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToImmutableArray());
SymbolIsBannedAnalyzerBase.cs (1)
442.SelectMany(ExpandConstituentNamespaces).ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
690var intersect = nextPragmaIds.Intersect(idsForPragma).ToImmutableArray();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (3)
385if (foreachStatements.ToImmutableArray() is [TStatementSyntax childStatement] && 417var whenTrueStatements = whenTrue.ToImmutableArray(); 437var whenFalseStatements = whenFalse.ToImmutableArray();
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();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (2)
21var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray(); 38var contextualProperties = contextualSymbol?.GetMembers().OfType<IPropertySymbol>().ToImmutableArray() ?? [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
605foreach (var match in matches.ToImmutableArray())
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
133var candidates = semanticModel.GetMemberGroup(expression, cancellationToken).OfType<IMethodSymbol>().ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
180arguments.Select(a => this.GenerateNameForArgument(document.SemanticModel, a, cancellationToken))).ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (3)
151(t, r) => CodeGenerationSymbolFactory.CreateParameterSymbol(r, t, name: "")).ToImmutableArray(); 164var remainingArguments = _arguments.Skip(argumentCount).ToImmutableArray(); 176var remainingParameterTypes = ParameterTypes.Skip(argumentCount).ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
153var unavailableMemberNames = GetUnavailableMemberNames(typeToGenerateIn).ToImmutableArray();
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
30.ToImmutableArray(); 36.ToImmutableArray();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
834.ToImmutableArray();
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
51diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start).ToImmutableArray(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (2)
86.ToImmutableArray(); 98.ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
156.ToImmutableArray();
Microsoft.CodeAnalysis.CSharp (11)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
2368var result = dictionary.Count != interfaces.Length ? dictionary.Values.ToImmutableArray() : interfaces;
BoundTree\LengthBasedStringSwitchData.cs (1)
193: CreateAndRegisterStringJumpTable(group.ToImmutableArray(), stringJumpTables);
BoundTree\UnboundLambda.cs (1)
177parameterRefKinds.IsDefault ? Enumerable.Repeat(RefKind.None, parameterTypes.Length).ToImmutableArray() : parameterRefKinds,
Compilation\CSharpCompilation.cs (1)
4834return firstTree.Options.PreprocessorSymbolNames.ToImmutableArray();
FlowAnalysis\ControlFlowAnalysis.cs (1)
46((IEnumerable<SyntaxNode>)EntryPointsWalker.Analyze(_context.Compilation, _context.Member, _context.BoundNode, _context.FirstInRegion, _context.LastInRegion, out _succeeded)).ToImmutableArray();
Lowering\SyntheticBoundNodeFactory.cs (1)
769=> New(ctor, args.ToImmutableArray());
SourceGeneration\CSharpGeneratorDriver.cs (1)
63=> new CSharpGeneratorDriver(parseOptions ?? CSharpParseOptions.Default, generators.ToImmutableArray(), optionsProvider ?? CompilerAnalyzerConfigOptionsProvider.Empty, additionalTexts.AsImmutableOrEmpty(), driverOptions);
Symbols\FileIdentifier.cs (1)
49hash = hashAlgorithm.ComputeHash(encodedFilePath).ToImmutableArray();
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
353lazyFilePathChecksum = ordinal.ToImmutableArray(),
Symbols\Source\SourceMemberContainerSymbol.cs (1)
824ImmutableInterlocked.InterlockedInitialize(ref _managedKindUseSiteDependencies, managedKindUseSiteInfo.Dependencies?.ToImmutableArray() ?? ImmutableArray<AssemblySymbol>.Empty);
Symbols\Source\SourcePropertySymbolBase.cs (1)
1698=> GetAttributes().Where(a => a.IsTargetAttribute(attributeDescription)).Cast<SourceAttributeData>().ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
53var leadingDirectives = statement.GetLeadingTrivia().Where(IsAnyCodeDirective).ToImmutableArray(); 54var closeBraceLeadingDirectives = block.CloseBraceToken.LeadingTrivia.Where(IsAnyCodeDirective).ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
68var originalStatements = generator.GetStatements(container).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
266var allUsings = usings.Concat(usingsFromNamespaces).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
52.ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
204var leadingTrivia = firstMember.GetLeadingTrivia().ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (4)
63arguments.Select(a => a.NameColon != null)).ToImmutableArray(); 66arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray(); 86arguments.Select(a => a.NameEquals != null)).ToImmutableArray(); 89arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
572.ToImmutableArray();
Formatting\CSharpFormattingInteractionService.cs (1)
88return Task.FromResult(Formatter.GetFormattedTextChanges(parsedDocument.Root, [formattingSpan], document.Project.Solution.Services, options, cancellationToken).ToImmutableArray());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\SymbolMatcherTests.cs (1)
87var members = builder.ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (16)
Attributes\AttributeTests_WellKnownAttributes.cs (3)
11437var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 11462var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 11493var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray();
Diagnostics\DiagnosticAnalyzerTests.AllInOne.cs (3)
43var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>()); 104var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>()); 116new[] { new TestAdditionalText("myfilepath", text) }.ToImmutableArray<AdditionalText>()
Diagnostics\DiagnosticAnalyzerTests.cs (2)
1708var files = compilation.SyntaxTrees.Select(t => t.FilePath).ToImmutableArray(); 3606analyzers.ToImmutableArray(),
Diagnostics\DiagnosticSuppressorTests.cs (1)
715var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Diagnostics\GetDiagnosticsTests.cs (1)
968var group2 = semanticDiagnostics.Except(group1).ToImmutableArray();
FirstClassSpanTests.cs (1)
2857var casts = tree.GetRoot().DescendantNodes().OfType<CastExpressionSyntax>().ToImmutableArray();
FlowAnalysis\FlowTests.cs (1)
5842var declarations = tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToImmutableArray();
PartialEventsAndConstructorsTests.cs (4)
1988var eventDefs = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().ToImmutableArray(); 1991var eventImpls = tree.GetRoot().DescendantNodes().OfType<EventDeclarationSyntax>().ToImmutableArray(); 2031var ctors = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().ToImmutableArray(); 2099var ctors = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Features (13)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
270var textChanges = result.GetTextChanges(cancellationToken).ToImmutableArray();
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
364var namespaceDecls = node.AncestorsAndSelf().OfType<BaseNamespaceDeclarationSyntax>().ToImmutableArray();
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
39.OfType<BaseNamespaceDeclarationSyntax>().ToImmutableArray();
ConvertAnonymousType\CSharpConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
42var originalSeparators = declarators.GetSeparators().ToImmutableArray();
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
52=> OneOrMany.Create(GlobalStatements.ToImmutableArray<SyntaxNode>());
ExtractMethod\CSharpSelectionResult.cs (1)
137=> exitPoints.OfType<ReturnStatementSyntax>().ToImmutableArray().CastArray<StatementSyntax>();
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
79context.RegisterRefactorings(refactorings.ToImmutableArray(), context.Span);
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
91.ToImmutableArray()
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
68var originalStatements = generator.GetStatements(container).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
266var allUsings = usings.Concat(usingsFromNamespaces).ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
52.ToImmutableArray();
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
204var leadingTrivia = firstMember.GetLeadingTrivia().ToImmutableArray();
Structure\Providers\FileScopedNamespaceDeclarationStructureProvider.cs (1)
28var externsAndUsings = Enumerable.Union<SyntaxNode>(fileScopedNamespaceDeclaration.Externs, fileScopedNamespaceDeclaration.Usings).ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (29)
Semantics\LambdaTests.cs (14)
3936var attributeSyntaxes = tree.GetRoot().DescendantNodes().OfType<AttributeSyntax>().ToImmutableArray(); 4121var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4156var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4184var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4211var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4786var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4871var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4926var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4953var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 4981var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 8005.ToImmutableArray(); 8110var decls = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().ToImmutableArray(); 8352var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray(); 8385var exprs = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().ToImmutableArray();
Semantics\LocalFunctionTests.cs (4)
2587var exprs = tree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().ToImmutableArray(); 6489var exprs = tree.GetRoot().DescendantNodes().OfType<TypeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray(); 6536var exprs = tree.GetRoot().DescendantNodes().OfType<SizeOfExpressionSyntax>().Select(n => n.Type).ToImmutableArray(); 6554ToImmutableArray();
Semantics\NameOfTests.cs (4)
1020.ToImmutableArray(); 1094.ToImmutableArray(); 1177.ToImmutableArray(); 1258.ToImmutableArray();
Semantics\NullableReferenceTypesTests.cs (5)
62883var declarators = syntaxTree.GetRoot().DescendantNodes().OfType<AnonymousObjectMemberDeclaratorSyntax>().ToImmutableArray(); 161283var arms = syntaxTree.GetRoot().DescendantNodes().OfType<SwitchExpressionArmSyntax>().ToImmutableArray(); 161287var identifiers = unreachableArm.DescendantNodes().OfType<IdentifierNameSyntax>().ToImmutableArray(); 161329var sections = syntaxTree.GetRoot().DescendantNodes().OfType<SwitchSectionSyntax>().ToImmutableArray(); 161333var identifiers = unreachableSection.DescendantNodes().OfType<IdentifierNameSyntax>().ToImmutableArray();
Semantics\OverloadResolutionPerfTests.cs (1)
1060var exprs = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().ToImmutableArray();
SourceGeneration\GeneratorDriverTests.cs (1)
2077driver = driver.RemoveAdditionalTexts(texts.ToImmutableArray());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\LineSpanDirectiveTests.cs (2)
246var actualVisibility = textB.Lines.Select(line => treeB.GetLineVisibility(line.Start)).ToImmutableArray(); 468return tree.GetLineMappings().Select(mapping => mapping.ToString()!).ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
TestAttributesVisitor.cs (1)
164var arguments = attribute.ConstructorArguments.ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
53var leadingDirectives = statement.GetLeadingTrivia().Where(IsAnyCodeDirective).ToImmutableArray(); 54var closeBraceLeadingDirectives = block.CloseBraceToken.LeadingTrivia.Where(IsAnyCodeDirective).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (4)
63arguments.Select(a => a.NameColon != null)).ToImmutableArray(); 66arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray(); 86arguments.Select(a => a.NameEquals != null)).ToImmutableArray(); 89arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray();
Microsoft.CodeAnalysis.EditorFeatures (10)
CodeActions\CodeActionEditHandlerService.cs (4)
205var projectChanges = changes.GetProjectChanges().ToImmutableArray(); 228var changedAdditionalDocuments = projectChange.GetChangedAdditionalDocuments().ToImmutableArray(); 229var changedDocuments = projectChange.GetChangedDocuments(onlyGetDocumentsWithTextChanges: true).ToImmutableArray(); 230var changedAnalyzerConfigDocuments = projectChange.GetChangedAnalyzerConfigDocuments().ToImmutableArray();
CommentSelection\ToggleLineCommentCommandHandler.cs (1)
86span => GetLinesFromSelectedSpan(span).ToImmutableArray());
EditAndContinue\ActiveStatementTrackingService.cs (1)
198var openDocumentIds = _workspace.GetOpenDocumentIds().ToImmutableArray();
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (1)
36var analyzerReferences = RoslynEnumerableExtensions.DistinctBy(projectsInScope.SelectMany(p => p.AnalyzerReferences), a => a.Id).ToImmutableArray();
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
357.Select(document => (document, conflictResolution.GetReplacements(document.Id).Where(r => GetRenameSpanKind(r.Kind) != RenameSpanKind.None).ToImmutableArray())) 358.ToImmutableArray(); 443.ToImmutableArray();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
29var documents = project.Documents.ToImmutableArray();
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
28var documents = project.Documents.ToImmutableArray();
Squiggles\SquiggleUtilities.cs (1)
44var spans = tagger.GetTags(snapshot.GetSnapshotSpanCollection()).ToImmutableArray();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeFixes\ExtensionOrderingTests.cs (2)
130var expectedOrder = ExtensionOrderer.Order(langProviders).Select(lazy => lazy.Value).ToImmutableArray(); 137var actualOrder = codeFixPriorityMap.OrderBy(kvp => kvp.Value).Select(kvp => kvp.Key).ToImmutableArray();
InheritanceMargin\InheritanceMarginTests.cs (2)
115var sortedExpectedItems = memberItems.OrderBy(item => item.LineNumber).ToImmutableArray(); 133.ToImmutableArray();
Snippets\RoslynLSPSnippetConvertTests.cs (1)
510var placeholders = spans.Select(span => span.Start).ToImmutableArray();
SuggestedActions\SuggestedActionSourceProviderTests.cs (1)
22.ToImmutableArray();
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticServiceTests.vb (1)
2023Dim analyzerReference = New AnalyzerImageReference(analyzers.ToImmutableArray())
Diagnostics\NamingStyles\NamingStyleTests.vb (1)
27Assert.Equal(expectedName, namingStyle.CreateName(words.ToImmutableArray()))
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
PDB\MethodDebugInfo.Native.cs (1)
641var signature = constant.GetSignature().ToImmutableArray();
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (1)
CSharpFunctionResolverTests.cs (1)
463new Module(metadata: TestResources.MetadataTests.Invalid.IncorrectCustomAssemblyTableSize_TooManyMethodSpecs.ToImmutableArray()));
Microsoft.CodeAnalysis.Extensions.Package (1)
Symbols\INamedTypeSymbolExtensions.cs (1)
605foreach (var match in matches.ToImmutableArray())
Microsoft.CodeAnalysis.ExternalAccess.FSharp (4)
Internal\Editor\FSharpEditorFormattingService.cs (4)
82return changes?.ToImmutableArray() ?? []; 88return changes?.ToImmutableArray() ?? []; 94return changes?.ToImmutableArray() ?? []; 100return changes?.ToImmutableArray() ?? [];
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (4)
RazorMappingServiceWrapper.cs (3)
47return changes.ToImmutableArray(); 62return roslynSpans.ToImmutableArray(); 79return roslynSpans.ToImmutableArray();
Remote\RazorServiceDescriptorsWrapper.cs (1)
53return options.Converters.ToImmutableArray();
Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler (1)
GeneratorExtensions.cs (1)
36public static ImmutableArray<(string Key, string Value)> GetHostOutputs(this GeneratorRunResult runResult) => runResult.HostOutputs.ToImmutableArray().SelectAsArray(a => (a.Key, a.Value.ToString() ?? ""));
Microsoft.CodeAnalysis.ExternalAccess.Xaml (2)
External\ConversionHelpers.cs (1)
26.ToImmutableArray();
Internal\DescriptionService.cs (1)
93return builder.ToImmutableArray();
Microsoft.CodeAnalysis.Features (48)
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
89var sortedPackages = result.ToImmutableArray().Sort();
ChangeSignature\SignatureChange.cs (2)
107var originalListWithoutRemovedOrAdded = originalListOfParameters.Where(updatedListOfParameters.Contains).ToImmutableArray(); 108var updatedListWithoutRemovedOrAdded = updatedListOfParameters.Where(originalListOfParameters.Contains).ToImmutableArray();
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (2)
159var result = bag.ToImmutableArray(); 307.ToImmutableArray();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
111var trivia = startToken.LeadingTrivia.ToImmutableArray();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
139var attributeRemoveFixesForTree = removeSuppressionFixesForTree.OfType<AttributeRemoveAction>().ToImmutableArray();
CodeLens\CodeLensReferencesService.cs (2)
213return result.ToImmutableArray(); 271return result.OfType<ReferenceMethodDescriptor>().ToImmutableArray();
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
184var typeNameParts = GetTypeNamePartsForNestedTypeNode(typeNode).ToImmutableArray();
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (2)
383=> @namespace?.Split(s_dotSeparator).ToImmutableArray() ?? default; 472.ToImmutableArray();
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
61: state.RelativeDeclaredNamespace.Split(['.']).ToImmutableArray();
Completion\CompletionService_GetCompletions.cs (1)
106var exclusiveContexts = triggeredContexts.Where(t => t.IsExclusive).ToImmutableArray();
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
54var changesArray = changes.ToImmutableArray();
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
323var originalProperties = anonymousType.GetMembers().OfType<IPropertySymbol>().ToImmutableArray();
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
347var afterPlaceholderArguments = arguments.Skip(placeholderIndex + 1).ToImmutableArray();
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
862field.Name)))).ToImmutableArray();
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
78var languageIdentifiers = _identifierToServices.Keys.ToImmutableArray();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
47_analyzerProviders = analyzerProviders.GroupBy(kv => kv.Metadata.Name).ToImmutableDictionary(g => g.Key, g => g.ToImmutableArray());
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
264var reanalyzers = workItem.SpecificAnalyzers.ToImmutableArray();
ExtractMethod\MethodExtractor.Analyzer.cs (1)
148var allVariableInfos = symbolMap.Values.Order().ToImmutableArray();
FullyQualify\AbstractFullyQualifyService.cs (1)
101.ToImmutableArray();
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
61var mappedMembers = selectedMembers.Select(m => TryMapToWritableInstanceFieldOrProperty(service, m, cancellationToken)).Distinct().ToImmutableArray();
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
229var validParameters = _methodSymbol.Parameters.Intersect(expressionParameterMap.Values).ToImmutableArray();
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
477var statementsAfterIf = statements.Skip(index + 1).ToImmutableArray();
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
254var captures = analysis.CapturedInside.Except(analysis.VariablesDeclared).ToImmutableArray();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
334metadataReferences: project.MetadataReferences.ToImmutableArray()); // TODO: Read references from PDB info: https://github.com/dotnet/roslyn/issues/55834
QuickInfo\QuickInfoServiceWithProviders.cs (1)
40.ToImmutableArray();
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
34var argumentNames = getArgumentNames(argumentList).ToImmutableArray();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (3)
385if (foreachStatements.ToImmutableArray() is [TStatementSyntax childStatement] && 417var whenTrueStatements = whenTrue.ToImmutableArray(); 437var whenFalseStatements = whenFalse.ToImmutableArray();
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
133var candidates = semanticModel.GetMemberGroup(expression, cancellationToken).OfType<IMethodSymbol>().ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
164var remainingArguments = _arguments.Skip(argumentCount).ToImmutableArray(); 176var remainingParameterTypes = ParameterTypes.Skip(argumentCount).ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
153var unavailableMemberNames = GetUnavailableMemberNames(typeToGenerateIn).ToImmutableArray();
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
30.ToImmutableArray(); 36.ToImmutableArray();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
834.ToImmutableArray();
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
51diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start).ToImmutableArray(),
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\StackFrameMethodSymbolResolver.cs (1)
28.ToImmutableArray();
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
173.ToImmutableArray();
UnusedReferences\UnusedReferencesRemover.cs (1)
70.ToDictionary(group => group.Key, group => group.ToImmutableArray());
ValueTracking\ValueTracker.OperationCollector.cs (1)
188.ToImmutableArray();
Wrapping\AbstractCodeActionComputer.cs (1)
226var tokens = leftTokenToTrailingTrivia.Keys.Concat(rightTokenToLeadingTrivia.Keys).Distinct().ToImmutableArray();
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
139: (from project in solution.Projects from documentId in project.DocumentIds select documentId).ToImmutableArray();
Microsoft.CodeAnalysis.InteractiveHost (2)
Interactive\Core\InteractiveHost.Service.cs (2)
422var newSourcePaths = globals.SourcePaths.ToImmutableArray(); 423var newReferencePaths = globals.ReferencePaths.ToImmutableArray();
Microsoft.CodeAnalysis.LanguageServer (2)
HostWorkspace\LanguageServerWorkspaceFactory.cs (1)
45.ToImmutableArray();
HostWorkspace\ProjectDependencyHelper.cs (1)
112.ToImmutableDictionary(g => g.Key, g => g.ToImmutableArray(), StringComparer.OrdinalIgnoreCase);
Microsoft.CodeAnalysis.LanguageServer.Protocol (12)
Extensions\Extensions.cs (1)
186var projects = solution.Projects.Where(project => project.FilePath == projectIdentifier.DocumentUri.ParsedUri.LocalPath).ToImmutableArray();
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (2)
293var nonSuppressionActions = actions.Where(a => !IsTopLevelSuppressionAction(a.OriginalCodeAction)).ToImmutableArray(); 297!IsBulkConfigurationAction(a.OriginalCodeAction)).ToImmutableArray();
Handler\Diagnostics\AbstractWorkspacePullDiagnosticsHandler.cs (1)
95foreach (var category in _categoryToLspChanged.Keys.ToImmutableArray())
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (1)
135var result = sources.ToImmutableArray();
Handler\Diagnostics\Public\PublicWorkspacePullDiagnosticsHandler.cs (1)
95}).ToImmutableArray();
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
58=> diagnosticsParams.PreviousResults?.Where(d => d.PreviousResultId != null).Select(d => new PreviousPullResult(d.PreviousResultId!, d.TextDocument!)).ToImmutableArray();
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
194?.ToImmutableArray() ?? [];
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (2)
81return codeSnippetsElement.Elements().Where(e => e.Name.LocalName.Equals("CodeSnippet", StringComparison.OrdinalIgnoreCase)).ToImmutableArray(); 112return ReadCodeSnippetElements(document)?.Select(element => new CodeSnippet(element)).ToImmutableArray();
Handler\SemanticTokens\SemanticTokensSchema.cs (1)
103.ToImmutableArray();
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
29=> requestParams.PreviousResults?.Where(d => d.PreviousResultId != null).Select(d => new PreviousPullResult(d.PreviousResultId!, d.TextDocument!)).ToImmutableArray();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Diagnostics\PullDiagnosticTests.cs (1)
1986var previousResultIds = previousResults.Select(param => param.resultId).ToImmutableArray();
MapCode\MapCodeTests.cs (1)
39return newText.GetTextChanges(text).ToImmutableArray();
SpellCheck\SpellCheckTests.cs (1)
546.ToImmutableArray();
Workspaces\LspWorkspaceManagerTests.cs (4)
671var oldClassDeclarations = originalRoot.DescendantNodes().Where(n => syntaxFacts.IsClassDeclaration(n)).ToImmutableArray(); 672var newClassDeclarations = newRoot.DescendantNodes().Where(n => syntaxFacts.IsClassDeclaration(n)).ToImmutableArray(); 681var oldMethodDeclarations = originalRoot.DescendantNodes().Where(n => syntaxFacts.IsMethodLevelMember(n)).ToImmutableArray(); 682var newMethodDeclarations = newRoot.DescendantNodes().Where(n => syntaxFacts.IsMethodLevelMember(n)).ToImmutableArray();
Microsoft.CodeAnalysis.PublicApiAnalyzers (4)
DeclarePublicApiAnalyzer.cs (1)
343skippedNamespaces = namespaceStrings.ToImmutableArray();
DeclarePublicApiAnalyzer.Impl.cs (1)
507var nestedNamespaceOrTypeMembers = containingSymbol.GetMembers().OfType<INamespaceOrTypeSymbol>().ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Microsoft.CodeAnalysis.Rebuild (7)
CompilationFactory.cs (1)
88.ToImmutableArray();
CompilationOptionsReader.cs (3)
192var sourceTextInfo = new SourceTextInfo(name, hashAlgorithm, hash.ToImmutableArray(), encoding); 237return new EmbeddedSourceTextInfo(sourceTextInfo, embeddedText, compressedHash?.ToImmutableArray() ?? ImmutableArray<byte>.Empty); 480return options.ToImmutableArray();
CSharpCompilationFactory.cs (2)
75: define.Split(',').ToImmutableArray(); 99cryptoPublicKey: optionsReader.GetPublicKey()?.ToImmutableArray() ?? default,
VisualBasicCompilationFactory.cs (1)
112cryptoPublicKey: optionsReader.GetPublicKey()?.ToImmutableArray() ?? default,
Microsoft.CodeAnalysis.Rebuild.UnitTests (8)
CSharpRebuildTests.cs (3)
39.ToImmutableArray(); 40var references = original.References.ToImmutableArray(); 41var rebuild = compilationFactory.CreateCompilation(sources, original.References.ToImmutableArray());
DeterministicKeyBuilderTests.cs (2)
229var property = GetJsonProperty(compilation.GetDeterministicKey(analyzers: analyzers.ToImmutableArray()), "analyzers"); 235var property = GetJsonProperty(compilation.GetDeterministicKey(generators: generators.ToImmutableArray()), "generators");
RoundTripUtil.cs (3)
95original.References.ToImmutableArray()); 119rebuildPdbBytes = new ReadOnlySpan<byte>(rebuildPdbReader.MetadataPointer, rebuildPdbReader.MetadataLength).ToArray().ToImmutableArray(); 146return new EmitInfo(originalBytes, originalReader, pdbSpan.ToArray().ToImmutableArray(), originalPdbReader);
Microsoft.CodeAnalysis.Remote.Workspaces (2)
VisualStudioMefHostServices.cs (2)
51return _exportProvider.GetExports<TExtension, TMetadata>().ToImmutableArray(); 67_exportProvider.GetExports<TExtension>().ToImmutableArray());
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Microsoft.CodeAnalysis.Test.Utilities (9)
AssemblyLoadTestFixture.cs (2)
460var fakeCompilerAssembly = GenerateDll("Microsoft.CodeAnalysis", analyzerWithFakeCompilerDependencyDirectory, publicKeyOpt: typeof(SyntaxNode).Assembly.GetName().GetPublicKey()?.ToImmutableArray() ?? default, csSource: @" 488var laterFakeCompilerAssembly = GenerateDll("Microsoft.CodeAnalysis", analyzerWithLaterFakeCompileDirectory, publicKeyOpt: typeof(SyntaxNode).Assembly.GetName().GetPublicKey()?.ToImmutableArray() ?? default, csSource: @"
CompilationVerifier.cs (2)
612dependencyList.ToImmutableArray(), 1048.ToImmutableArray();
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1258return _controlFlowGraphMapOpt.Values.OrderBy(flowGraphAndSymbol => flowGraphAndSymbol.Graph.OriginalOperation.Syntax.SpanStart).ToImmutableArray();
Diagnostics\DiagnosticExtensions.cs (1)
306var analyzersArray = analyzers.ToImmutableArray();
Diagnostics\TestDiagnosticAnalyzer.cs (1)
21protected static readonly ImmutableArray<string> AllAnalyzerMemberNames = new string[] { "AnalyzeCodeBlock", "AnalyzeCompilation", "AnalyzeNode", "AnalyzeSemanticModel", "AnalyzeSymbol", "AnalyzeSyntaxTree", "AnalyzeAdditionalFile", "Initialize", "SupportedDiagnostics" }.ToImmutableArray();
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
147: externAliases.Split(',').ToImmutableArray(),
TargetFrameworkUtil.cs (1)
429references = ((IEnumerable<PortableExecutableReference>)obj).ToImmutableArray();
Microsoft.CodeAnalysis.UnitTests (15)
Collections\ImmutableArrayExtensionsTests.cs (8)
533Assert.True(array.ToImmutableArray().IsSubsetOf(other.ToImmutableArray())); 534Assert.False(other.ToImmutableArray().IsSubsetOf(array.ToImmutableArray())); 544Assert.True(array.ToImmutableArray().IsSubsetOf(other.ToImmutableArray())); 545Assert.True(other.ToImmutableArray().IsSubsetOf(array.ToImmutableArray()));
Collections\TemporaryArrayTests.cs (3)
92array.AddRange(Enumerable.Range(0, TemporaryArray<int>.TestAccessor.InlineCapacity + 1).ToImmutableArray()); 108array.AddRange(Enumerable.Range(0, addedItems).ToImmutableArray()); 257result.Add(values.ToImmutableArray());
Collections\TopologicalSortTests.cs (1)
22=> (ref TemporaryArray<T> builder, T value) => builder.AddRange(successors[toInt(value)].ToImmutableArray());
Diagnostics\AnalysisContextInfoTests.cs (1)
29var options = new AnalyzerOptions(new[] { new TestAdditionalText() }.ToImmutableArray<AdditionalText>());
PDB\CustomDebugInfoReaderTests.cs (2)
21Assert.Equal(expected, CustomDebugInfoReader.DecodeForwardIteratorRecord(bytes.ToImmutableArray())); 30Assert.Throws<InvalidOperationException>(() => CustomDebugInfoReader.DecodeForwardIteratorRecord(bytes.ToImmutableArray()));
Microsoft.CodeAnalysis.VisualBasic (2)
Analysis\FlowAnalysis\ControlFlowAnalysis.vb (2)
44DirectCast(EntryPointsWalker.Analyze(_context.AnalysisInfo, _context.RegionInfo, _succeeded), IEnumerable(Of SyntaxNode)).ToImmutableArray()) 58DirectCast(ExitPointsWalker.Analyze(_context.AnalysisInfo, _context.RegionInfo), IEnumerable(Of SyntaxNode)).ToImmutableArray())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (1)
69Return unnecessaryImports.ToImmutableArray()
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
104document, currentCastNodes.ToImmutableArray(),
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
2537Dim references = parsedArgs.ResolveMetadataReferences(metadataResolver).ToImmutableArray() 2553Dim references = parsedArgs.ResolveMetadataReferences(metadataResolver).ToImmutableArray()
Microsoft.CodeAnalysis.VisualBasic.Features (4)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
627Return node.GetLeadingTrivia().ToImmutableArray()
SplitOrMergeIfStatements\VisualBasicIfLikeStatementGenerator.vb (2)
100Return AddIfNotNull(ifBlock.ElseIfBlocks, ifBlock.ElseBlock).ToImmutableArray() 105Return AddIfNotNull(nextElseIfBlocks, ifBlock.ElseBlock).ToImmutableArray()
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
104document, currentCastNodes.ToImmutableArray(),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Diagnostics\DiagnosticAnalyzerTests.AllInOne.vb (3)
22Dim options = New AnalyzerOptions({DirectCast(New TestAdditionalText(), AdditionalText)}.ToImmutableArray()) 48Dim options = New AnalyzerOptions({CType(new TestAdditionalText(), AdditionalText)}.ToImmutableArray()) 57Dim options = New AnalyzerOptions(additionalTexts.ToImmutableArray())
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
CompilationTestUtils.vb (1)
979Return DumpAllDiagnostics(allDiagnostics.ToImmutableArray(), suppressInfos)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (1)
69Return unnecessaryImports.ToImmutableArray()
Microsoft.CodeAnalysis.Workspaces (45)
CodeActions\CodeAction_Cleanup.cs (1)
70return documentIds.ToImmutableArray();
CodeActions\Operations\ApplyChangesOperation.cs (1)
117.Concat(changedProject.GetChangedAnalyzerConfigDocuments()).ToImmutableArray();
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (2)
120.ToImmutableArray(); 210var allDocChanges = group.ToImmutableArray();
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
69.ToImmutableArray();
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
193: map.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.ToImmutableArray());
FindSymbols\Declarations\DeclarationFinder.cs (1)
61var symbolsWithName = symbols.ToImmutableArray();
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
29.ToImmutableArray<ISymbol>();
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (1)
108.ToImmutableArray();
PatternMatching\AllLowerCamelCaseMatcher.cs (1)
58? new NormalizedTextSpanCollection(result.Value.MatchedSpansInReverse).ToImmutableArray()
PatternMatching\PatternMatcher.cs (1)
546? new NormalizedTextSpanCollection(matchSpans.ToImmutableAndClear()).ToImmutableArray()
Remote\RemoteUtilities.cs (1)
37builder.Add((docId, textChanges.ToImmutableArray()));
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
719var possibleNameConflicts = possibleNameConflictsList.ToImmutableArray();
Rename\ConflictEngine\MutableConflictResolution.cs (3)
147this.RelatedLocations.Select(l => l.DocumentId)).Distinct().ToImmutableArray(); 149var relatedLocations = this.RelatedLocations.ToImmutableArray(); 154g => g.Key, g => g.ToImmutableArray());
Rename\SymbolicRenameLocations.cs (2)
144var implicitLocations = referenceSymbols.SelectMany(refSym => refSym.Locations).Where(loc => loc.IsImplicit).ToImmutableArray(); 145var referencedSymbols = referenceSymbols.Select(r => r.Definition).Where(r => !r.Equals(symbol)).ToImmutableArray();
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
106let aliasLocations = r.Locations.Where(loc => SymbolEquivalenceComparer.Instance.Equals(loc.Alias, aliasSymbol)).ToImmutableArray()
Shared\Extensions\ISymbolExtensions.cs (1)
425var typeParameterRefs = document.Descendants(DocumentationCommentXmlNames.TypeParameterReferenceElementName).ToImmutableArray();
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
395return _resolvedToOriginalPathMap.Select(x => (x.Value, x.Key)).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (2)
21var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray(); 38var contextualProperties = contextualSymbol?.GetMembers().OfType<IPropertySymbol>().ToImmutableArray() ?? [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
605foreach (var match in matches.ToImmutableArray())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
245var importsToAdd = importToSyntax.Where(kvp => safeImportsToAdd.Contains(kvp.Key)).Select(kvp => kvp.Value).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (1)
168var contextSpine = applicableContainer.GetAncestorsOrThis<SyntaxNode>().ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (2)
86.ToImmutableArray(); 98.ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
156.ToImmutableArray();
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (1)
58_primaryKeyColumns = primaryKeysArray.ToImmutableArray().Add((DataNameIdColumnName, SQLiteIntegerType));
Workspace\CommandLineProject.cs (1)
200return directory.Split(s_folderSplitters, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
Workspace\Solution\Document.cs (1)
483var textChanges = text.GetTextChanges(oldText).ToImmutableArray();
Workspace\Solution\Solution.cs (1)
805var collection = analyzerReferences.ToImmutableArray();
Workspace\Solution\SolutionCompilationState.cs (3)
762var addedReferences = stateChange.NewProjectState.AnalyzerReferences.Except<AnalyzerReference>(stateChange.OldProjectState.AnalyzerReferences, ReferenceEqualityComparer.Instance).ToImmutableArray(); 763var removedReferences = stateChange.OldProjectState.AnalyzerReferences.Except<AnalyzerReference>(stateChange.NewProjectState.AnalyzerReferences, ReferenceEqualityComparer.Instance).ToImmutableArray(); 1352.ToImmutableArray();
Workspace\Solution\SolutionState.cs (6)
762var oldReferences = oldProject.ProjectReferences.ToImmutableArray(); 778var oldReferences = oldProject.ProjectReferences.ToImmutableArray(); 871var oldReferences = oldProject.MetadataReferences.ToImmutableArray(); 884var oldReferences = oldProject.MetadataReferences.ToImmutableArray(); 1235var oldReferences = AnalyzerReferences.ToImmutableArray(); 1242var oldReferences = AnalyzerReferences.ToImmutableArray();
Workspace\Workspace.cs (2)
1600var projectChangesList = solutionChanges.GetProjectChanges().ToImmutableArray(); 1777var changedDocumentIds = projectChanges.GetChangedDocuments(onlyGetDocumentsWithTextChanges: true, IgnoreUnchangeableDocumentsWhenApplyingChanges).ToImmutableArray();
Microsoft.CodeAnalysis.Workspaces.Desktop (2)
Workspace\Host\Mef\MefV1HostServices.cs (2)
86return _exportProvider.GetExports<TExtension, TMetadata>().ToImmutableArray(); 102_exportProvider.GetExports<TExtension>().ToImmutableArray());
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (6)
MSBuild\ProjectFile\ProjectFile.cs (6)
165.ToImmutableArray(); 169.ToImmutableArray(); 173.ToImmutableArray(); 180var fileGlobs = _loadedProject?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? []; 227.ToImmutableArray(); 277var folders = relativePath == null ? [] : relativePath.Split([PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
734var aliases = aliasElement != null ? aliasElement.Split(',').Select(s => s.Trim()).ToImmutableArray() : default;
Workspaces\TestWorkspace`1.cs (1)
664var aliases = projectReference.Attributes(AliasAttributeName).Select(a => a.Value).ToImmutableArray();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
4611return solution.GetProject(pid).GetCompilationAsync().Result.SyntaxTrees.ToImmutableArray();
Microsoft.DotNet.SignTool (4)
src\Configuration.cs (2)
201return new BatchSignInput(_filesToSign.ToImmutableArray(), _zipDataMap.ToImmutableDictionary(), _filesToCopy.ToImmutableArray());
src\ContentUtil.cs (2)
40public static readonly ImmutableArray<byte> EmptyFileContentHash = GetContentHash(new MemoryStream()).ToImmutableArray(); 59return bytes.ToImmutableArray<byte>();
Microsoft.DotNet.SignTool.Tests (1)
FakeBuildEngine.cs (1)
58var filesToSign = itemGroupNode.Descendants("FilesToSign").ToImmutableArray();
Microsoft.DotNet.StrongName (2)
Signing.cs (1)
168if (!TryParseKey(File.ReadAllBytes(keyFile).ToImmutableArray(), out ImmutableArray<byte> snkPublicKey, out RSAParameters? privateKey) ||
Verification.cs (1)
107publicKeyBlob = Constants.ECMAKey.ToImmutableArray();
Microsoft.DotNet.XUnitAssert.Tests (22)
EquivalenceAssertsTests.cs (22)
704 Assert.Equivalent(new[] { 1, 4 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: false); 710 var expected = new { x = new[] { 1, 4 }.ToImmutableArray() }; 711 var actual = new { x = new[] { 9, 4, 1 }.ToImmutableArray() }; 719 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: false)); 733 var expected = new { x = new[] { 1, 6 }.ToImmutableArray() }; 734 var actual = new { x = new[] { 9, 4, 1 }.ToImmutableArray() }; 753 Assert.Equivalent(new[] { 1, 9, 4 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: true); 759 var expected = new { x = new[] { 1, 9, 4 }.ToImmutableArray() }; 760 var actual = new { x = new[] { 9, 4, 1 }.ToImmutableArray() }; 768 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: true)); 782 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 9, 4 }.ToImmutableArray(), new[] { 6, 9, 4, 1 }.ToImmutableArray(), strict: true)); 796 var expected = new { x = new[] { 1, 6 }.ToImmutableArray() }; 797 var actual = new { x = new[] { 9, 4, 1 }.ToImmutableArray() }; 813 var expected = new { x = new[] { 1, 9, 4 }.ToImmutableArray() }; 814 var actual = new { x = new[] { 6, 9, 4, 1, 12 }.ToImmutableArray() }; 1136 Assert.Equivalent(new[] { 1, 2, 3 }, new[] { 1, 2, 3 }.ToImmutableArray()); 1142 Assert.Equivalent(new[] { 1, 2, 3 }.ToImmutableArray(), new[] { 1, 2, 3 });
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
HttpExceptionSummaryProvider.cs (1)
67_descriptions = descriptions.ToImmutableArray();
Microsoft.Gen.ContextualOptions (2)
Parser.cs (2)
18.Select(type => new OptionsContextType(type.Key, type.Value.ToImmutableArray(), GetContextProperties(type.Key))) 88.ToImmutableArray();
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
EmitterTests.cs (4)
30.ToImmutableArray(); 53.ToImmutableArray(); 81.ToImmutableArray(); 109.ToImmutableArray();
Microsoft.Gen.Logging.Unit.Tests (5)
LogParserUtilitiesTests.cs (1)
91.Returns(Array.Empty<AttributeData>().ToImmutableArray());
ParserUtilitiesTests.cs (3)
51.Returns(new[] { syntaxReferenceMock.Object, anotherSyntaxReferenceMock.Object }.ToImmutableArray()); 72.Returns(new[] { syntaxReferenceMock.Object }.ToImmutableArray()); 108.Returns(new[] { locationMock, Mock.Of<Location>() }.ToImmutableArray());
SymbolLoaderTests.cs (1)
30Array.Empty<MetadataReference>().ToImmutableArray(),
Microsoft.Interop.ComInterfaceGenerator (4)
ComMethodContext.cs (1)
211var imm = methods.ToImmutableArray();
ComMethodInfo.cs (1)
97new ComMethodInfo(null!, method.Name, method.GetAttributes().Select(AttributeInfo.From).ToImmutableArray().ToSequenceEqual(), false),
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
VtableIndexStubGenerator.cs (1)
320new SequenceEqualImmutableArray<DiagnosticInfo>(generatorDiagnostics.Diagnostics.ToImmutableArray()),
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
214new SequenceEqualImmutableArray<DiagnosticInfo>(generatorDiagnostics.Diagnostics.ToImmutableArray()));
JSImportGenerator.cs (1)
196new SequenceEqualImmutableArray<DiagnosticInfo>(generatorDiagnostics.Diagnostics.ToImmutableArray()));
Microsoft.Interop.LibraryImportGenerator (3)
LibraryImportGenerator.cs (2)
318new SequenceEqualImmutableArray<AttributeSyntax>(additionalAttributes.ToImmutableArray(), SyntaxEquivalentComparer.Instance), 322new SequenceEqualImmutableArray<DiagnosticInfo>(generatorDiagnostics.Diagnostics.ToImmutableArray())
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
224new SequenceEqualImmutableArray<AttributeSyntax>(additionalAttributes.ToImmutableArray(), SyntaxEquivalentComparer.Instance), 227new SequenceEqualImmutableArray<DiagnosticInfo>(generatorDiagnostics.Diagnostics.ToImmutableArray())
Microsoft.Interop.SourceGeneration (9)
BoundGenerators.cs (2)
153.ToImmutableArray(), 169.Select(static info => GetInfoIndex(info)).ToImmutableArray();
GeneratedStatements.cs (1)
35Pin = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Pin }).Cast<FixedStatementSyntax>().ToImmutableArray(),
MarshallerShape.cs (1)
618.ToImmutableArray();
MarshallingAttributeInfo.cs (1)
129return field ??= GetElementDependencies().ToImmutableArray();
MethodSignatureDiagnosticLocations.cs (1)
48: this(syntax.Identifier.Text, syntax.ParameterList.Parameters.Select(p => p.Identifier.GetLocation()).ToImmutableArray(), syntax.Identifier.GetLocation())
SequenceEqualImmutableArray.cs (2)
51return new(source.ToImmutableArray(), comparer); 55return new(source.ToImmutableArray());
ValueEqualityImmutableDictionary.cs (1)
39foreach (var kvp in Map.ToImmutableArray().Sort())
Microsoft.Maui.Controls.BindingSourceGen (1)
EquatableArray.cs (1)
20 public EquatableArray(T[] array) : this(array.ToImmutableArray())
Microsoft.ML.Data (19)
DataDebuggerPreview.cs (2)
61RowView = rows.ToImmutableArray(); 62ColumnView = Enumerable.Range(0, n).Select(c => new ColumnInfo(data.Schema[c], columns[c].ToArray())).ToImmutableArray();
Evaluators\Metrics\ConfusionMatrix.cs (2)
81PerClassPrecision = precision.ToImmutableArray(); 82PerClassRecall = recall.ToImmutableArray();
Evaluators\Metrics\MulticlassClassificationMetrics.cs (3)
128TopKAccuracyForAllK = RowCursorUtils.Fetch<VBuffer<double>>(host, overallResult, MulticlassClassificationEvaluator.AllTopKAccuracy).DenseValues().ToImmutableArray(); 131PerClassLogLoss = perClassLogLoss.DenseValues().ToImmutableArray(); 144PerClassLogLoss = perClassLogLoss.ToImmutableArray();
Evaluators\Metrics\RankingMetrics.cs (4)
63DiscountedCumulativeGains = Fetch(RankingEvaluator.Dcg).DenseValues().ToImmutableArray(); 64NormalizedDiscountedCumulativeGains = Fetch(RankingEvaluator.Ndcg).DenseValues().ToImmutableArray(); 69DiscountedCumulativeGains = dcg.ToImmutableArray(); 70NormalizedDiscountedCumulativeGains = ndcg.ToImmutableArray();
Prediction\Calibrator.cs (6)
1915return new IsotonicCalibrator(Host, mins.ToImmutableArray(), maxes.ToImmutableArray(), values.ToImmutableArray()); 2030Mins = mins.ToImmutableArray(); 2031Maxes = maxes.ToImmutableArray(); 2032Values = values.ToImmutableArray();
Transforms\NormalizeColumnDbl.cs (1)
1377=> new NormalizingTransformer.BinNormalizerModelParameters<ImmutableArray<TFloat>>(_binUpperBounds.Select(b => ImmutableArray.Create(b)).ToImmutableArray(),
Transforms\NormalizeColumnSng.cs (1)
1540_binUpperBounds.Select(b => ImmutableArray.Create(b)).ToImmutableArray(),
Microsoft.ML.DataView (1)
VectorType.cs (1)
66Dimensions = dimensions.ToImmutableArray();
Microsoft.ML.StandardTrainers (1)
Standard\MulticlassClassification\OneVersusAllTrainer.cs (1)
273internal ImmutableArray<object> SubModelParameters => _impl.Predictors.Cast<object>().ToImmutableArray();
Microsoft.ML.Tests (3)
Transformers\NormalizerTests.cs (3)
257var transformers = transformer.ToImmutableArray(); 930var transformedDataArray = ML.Data.CreateEnumerable<DataPointOne>(noCdfData, false).ToImmutableArray(); 974var transformedDataArray = ML.Data.CreateEnumerable<DataPointVec>(noCdfData, false).ToImmutableArray();
Microsoft.ML.Transforms (9)
PermutationFeatureImportance.cs (3)
132return metricsDelta.ToImmutableArray(); 164return metricsDelta.ToImmutableArray(); 248return metricsDelta.ToImmutableArray();
Text\LdaTransform.cs (1)
1093_columns = columns.ToImmutableArray();
Text\NgramHashingTransformer.cs (3)
183_columns = columns.ToImmutableArray(); 195_columns = columns.ToImmutableArray(); 327_columns = columns.ToImmutableArray();
Text\NgramTransform.cs (2)
217_transformInfos = transformInfos.ToImmutableArray(); 405_transformInfos = transformInfos.ToImmutableArray();
Microsoft.VisualStudio.LanguageServices (6)
CallHierarchy\CallHierarchyProvider.cs (1)
138return finders.ToImmutableArray();
InheritanceMargin\InheritanceGlyphManager.cs (1)
167var index = lines.ToImmutableArray().BinarySearch(span.Start, CompareWithLineStartAndEnd);
Options\VisualStudioSettingsOptionPersister.cs (1)
191=> manager.TryGetValue(storageKey, out T[] value) == GetValueResult.Success ? (value is null ? default : value.ToImmutableArray()) : default(Optional<object?>);
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
108.ToImmutableArray();
UnusedReferences\Dialog\UnusedReferencesTableProvider.DataSource.cs (1)
39.ToImmutableArray();
Venus\ContainedDocument.DocumentServiceProvider.cs (1)
77var textChanges = (await newDocument.GetTextChangesAsync(oldDocument, cancellationToken).ConfigureAwait(false)).ToImmutableArray();
Microsoft.VisualStudio.LanguageServices.CSharp (4)
EditorConfigSettings\DataProvider\Whitespace\CSharpWhitespaceSettingsProvider.cs (4)
31AddRange(spacingOptions.ToImmutableArray()); 33AddRange(newLineOptions.ToImmutableArray()); 35AddRange(indentationOptions.ToImmutableArray()); 37AddRange(wrappingOptions.ToImmutableArray());
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
169var localPathsOfRemoteRoots = roots.Select(root => session.ConvertSharedUriToLocalPath(root)).ToImmutableArray();
Microsoft.VisualStudio.LanguageServices.UnitTests (6)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (5)
183Assert.Throws(Of InvalidOperationException)(Sub() source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray())) 210source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray()) 211source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray()) 228Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 257source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray())
Venus\DocumentService_IntegrationTests.vb (1)
510Return AddSource(source, columns.ToImmutableArray())
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Features\Completion\XamlCommitCharacters.cs (2)
31=> new(characters, nonInsertCharacters?.ToImmutableArray() ?? []); 34=> Create(characters.ToImmutableArray(), nonInsertCharacters);
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
67return builder.ToImmutableArray();
Roslyn.Diagnostics.Analyzers (7)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Roslyn.VisualStudio.DiagnosticsWindow (1)
OptionPages\PerformanceLoggersPage.cs (1)
57var loggerTypeNames = GetLoggerTypes(globalOptions).ToImmutableArray();
Roslyn.VisualStudio.Next.UnitTests (4)
Services\ServiceHubServicesTests.cs (3)
490var localGeneratedDocs = (await localProject.GetSourceGeneratedDocumentsAsync()).ToImmutableArray(); 491var remoteGeneratedDocs = (await remoteProject.GetSourceGeneratedDocumentsAsync()).ToImmutableArray(); 1526var documentNames = changedDocuments.ToImmutableArray();
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
207var analyzers = analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType).ToImmutableArray();
RunTests (11)
AssemblyScheduler.cs (7)
110kvp => kvp.Value.Select(WithTypeExecutionTime).ToImmutableArray()); 117var tests = typeInfo.Tests.Select(WithTestExecutionTime).ToImmutableArray(); 205return workItems.ToImmutableArray(); 224.ToImmutableArray(); 227.ToImmutableArray(); 264.Select(group => new TypeInfo(GetName(group.Key), group.Key, group.Select(test => new TestMethodInfo(GetName(test), test, TimeSpan.Zero)).ToImmutableArray())) 265.ToImmutableArray();
ProcessTestExecutor.cs (1)
60var filters = workItem.Filters.Values.SelectMany(filter => filter).Where(filter => !string.IsNullOrEmpty(filter.FullyQualifiedName)).ToImmutableArray();
Program.cs (1)
351return list.ToImmutableArray();
TestRunner.cs (2)
73return workItems.ToImmutableArray(); 165return new RunAllResult((failures == 0), completed.ToImmutableArray(), processResults.ToImmutable());
SemanticSearch.BuildTask (4)
GenerateFilteredReferenceAssembliesTask.cs (4)
118Rewrite(peImageBuffer, patterns.ToImmutableArray()); 391types.OrderBy(t => t.MetadataToken).ToImmutableArray(), 398methods.OrderBy(t => t.MetadataToken).ToImmutableArray(), 405fields.OrderBy(t => t.MetadataToken).ToImmutableArray(),
System.Reflection.Metadata (6)
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (6)
160userStringSizes.ToImmutableArray(), 161stringSizes.ToImmutableArray(), 162blobSizes.ToImmutableArray(), 163guidSizes.ToImmutableArray()); 186immutable[i] = array[i].ToImmutableArray(); 189return immutable.ToImmutableArray();
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
70.ToImmutableArray();
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationInfo.cs (1)
12var values = GetElementValues(enumType).OrderBy(e => e).Distinct().ToImmutableArray();
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ScreenRecordService.cs (1)
457return (signature, ihdr, idat.ToImmutableArray(), iend);
Test.Utilities (5)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();
Text.Analyzers (8)
IdentifiersShouldBeSpelledCorrectly.cs (1)
267.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
331select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray(); 338select ComputeSynchronously(child, context)).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\CompilationExtensions.cs (1)
45var guids = propertyValue.Split(';').Select(g => g.Trim()).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
902return parameterOrderedArguments.ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
489var names = optionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
53return ProduceTrimmedArray(itemOptionValue).ToImmutableArray();
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
37.ToImmutableArray();