6 instantiations of ImmutableDictionary
System.Collections.Immutable (6)
System\Collections\Immutable\ImmutableDictionary_2.cs (6)
25public static readonly ImmutableDictionary<TKey, TValue> Empty = new ImmutableDictionary<TKey, TValue>(); 449return new ImmutableDictionary<TKey, TValue>(_root, comparers, _count); 455var set = new ImmutableDictionary<TKey, TValue>(comparers); 841: new ImmutableDictionary<TKey, TValue>(comparers); 1052return new ImmutableDictionary<TKey, TValue>(root, comparers, count); 1070return root.IsEmpty ? this.Clear() : new ImmutableDictionary<TKey, TValue>(root, _comparers, adjustedCountIfDifferentRoot);
4187 references to ImmutableDictionary
Analyzer.Utilities.UnitTests (1)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (1)
98ImmutableDictionary<(Location Location, IMethodSymbol? Method), HazardousUsageEvaluationResult> actual =
AnalyzerRunner (20)
CodeRefactoringRunner.cs (7)
29private readonly ImmutableDictionary<string, ImmutableArray<CodeRefactoringProvider>> _refactorings; 30private readonly ImmutableDictionary<string, ImmutableHashSet<int>> _syntaxKinds; 37var refactorings = GetCodeRefactoringProviders(options.AnalyzerPath); 125private static ImmutableDictionary<string, ImmutableHashSet<int>> GetSyntaxKinds(ImmutableHashSet<string> refactoringNodes) 153private static ImmutableDictionary<string, ImmutableArray<CodeRefactoringProvider>> FilterRefactorings(ImmutableDictionary<string, ImmutableArray<Lazy<CodeRefactoringProvider, CodeRefactoringProviderMetadata>>> refactorings, Options options) 199private static ImmutableDictionary<string, ImmutableArray<Lazy<CodeRefactoringProvider, CodeRefactoringProviderMetadata>>> GetCodeRefactoringProviders(string path)
DiagnosticAnalyzerRunner.cs (13)
27private readonly ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> _analyzers; 34var analyzers = GetDiagnosticAnalyzers(options.AnalyzerPath); 49var modifiedSpecificDiagnosticOptions = project.CompilationOptions.SpecificDiagnosticOptions 86var analysisResult = await GetAnalysisResultAsync(solution, _analyzers, _options, cancellationToken).ConfigureAwait(false); 178private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken) 232private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> FilterAnalyzers(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Options options) 285private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzers(string path) 304private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzersFromFile(string path) 309return ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty 314private static async Task<ImmutableDictionary<ProjectId, AnalysisResult>> GetAnalysisResultAsync( 316ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, 407internal static void WriteTelemetry(ImmutableDictionary<ProjectId, AnalysisResult> dictionary)
Aspire.Dashboard (2)
Model\ResourceViewModel.cs (1)
39public required ImmutableDictionary<string, ResourcePropertyViewModel> Properties { get; init; }
ServiceClient\Partials.cs (1)
136private ImmutableDictionary<string, ResourcePropertyViewModel> CreatePropertyViewModels(RepeatedField<ResourceProperty> properties, IKnownPropertyLookup knownPropertyLookup, ILogger logger)
Aspire.Dashboard.Components.Tests (2)
Pages\ResourcesTests.cs (1)
376Properties = ImmutableDictionary<string, ResourcePropertyViewModel>.Empty,
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
39Properties = properties?.ToImmutableDictionary() ?? ImmutableDictionary<string, ResourcePropertyViewModel>.Empty,
Aspire.Dashboard.Tests (1)
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
39Properties = properties?.ToImmutableDictionary() ?? ImmutableDictionary<string, ResourcePropertyViewModel>.Empty,
BuildActionTelemetryTable (3)
CodeActionDescriptions.cs (1)
12public static ImmutableDictionary<string, string> CodeActionDescriptionMap { get; } = new Dictionary<string, string>()
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
GenerateDocumentationAndConfigFiles (117)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
ILLink.RoslynAnalyzer (10)
DataFlow\LocalDataFlowAnalysis.cs (3)
102var lValueFlowCaptures = LValueFlowCapturesProvider.CreateLValueFlowCaptures(cfg); 110var lValueFlowCaptures = LValueFlowCapturesProvider.CreateLValueFlowCaptures(cfg); 122ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
DataFlow\LocalDataFlowVisitor.cs (2)
49private readonly ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures; 64ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
DataFlow\LValueFlowCaptureProvider.cs (3)
51public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 60ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder? lvalueFlowCaptureIdBuilder = null; 91return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
51ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
TrimAnalysis\TrimDataFlowAnalysis.cs (1)
63ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
Metrics (94)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Metrics.Legacy (94)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Microsoft.Analyzers.Extra.Tests (1)
CallAnalysis\ArraysTests.cs (1)
122Assembly.GetAssembly(typeof(ImmutableDictionary<,>))!,
Microsoft.AspNetCore.Analyzers (2)
StartupAnalysis.cs (2)
11private readonly ImmutableDictionary<INamedTypeSymbol, ImmutableArray<object>> _analysesByType; 15ImmutableDictionary<INamedTypeSymbol, ImmutableArray<object>> analysesByType)
Microsoft.AspNetCore.Components.Endpoints (14)
FormMapping\Converters\DictionaryAdapters\ImmutableDictionaryBufferAdapter.cs (10)
9: IDictionaryBufferAdapter<ImmutableDictionary<TKey, TValue>, ImmutableDictionary<TKey, TValue>.Builder, TKey, TValue> 12public static ImmutableDictionary<TKey, TValue>.Builder Add(ref ImmutableDictionary<TKey, TValue>.Builder buffer, TKey key, TValue value) 18public static ImmutableDictionary<TKey, TValue>.Builder CreateBuffer() => ImmutableDictionary.CreateBuilder<TKey, TValue>(); 20public static ImmutableDictionary<TKey, TValue> ToResult(ImmutableDictionary<TKey, TValue>.Builder buffer) => buffer.ToImmutable(); 27ImmutableDictionary<TKey, TValue>, 29ImmutableDictionary<TKey, TValue>.Builder, 32ImmutableDictionary<TKey, TValue>.Builder,
FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
46var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => true, 114var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => 116ImmutableDictionary<TKey, TValue>, 118ImmutableDictionary<TKey, TValue>.Builder,
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Binding\FormDataMapperTests.cs (6)
913var expected = ImmutableDictionary.CreateRange(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, }); 914CanDeserialize_Dictionary<ImmutableDictionary<int, int>, ImmutableDictionary<int, int>, int, int>(expected); 929var expected = ImmutableDictionary.CreateRange(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, }); 951var dictionary = Assert.IsType<ImmutableDictionary<int, int>>(result);
Microsoft.AspNetCore.Http.Extensions (14)
src\Components\Endpoints\src\FormMapping\Converters\DictionaryAdapters\ImmutableDictionaryBufferAdapter.cs (10)
9: IDictionaryBufferAdapter<ImmutableDictionary<TKey, TValue>, ImmutableDictionary<TKey, TValue>.Builder, TKey, TValue> 12public static ImmutableDictionary<TKey, TValue>.Builder Add(ref ImmutableDictionary<TKey, TValue>.Builder buffer, TKey key, TValue value) 18public static ImmutableDictionary<TKey, TValue>.Builder CreateBuffer() => ImmutableDictionary.CreateBuilder<TKey, TValue>(); 20public static ImmutableDictionary<TKey, TValue> ToResult(ImmutableDictionary<TKey, TValue>.Builder buffer) => buffer.ToImmutable(); 27ImmutableDictionary<TKey, TValue>, 29ImmutableDictionary<TKey, TValue>.Builder, 32ImmutableDictionary<TKey, TValue>.Builder,
src\Components\Endpoints\src\FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
46var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => true, 114var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => 116ImmutableDictionary<TKey, TValue>, 118ImmutableDictionary<TKey, TValue>.Builder,
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
18public override IReadOnlyDictionary<object, object> AdditionalValues { get; } = ImmutableDictionary<object, object>.Empty;
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
759return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
759return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
759return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.Build (35)
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
19return ImmutableDictionary<string, string?>.Empty;
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
154public Section(string name, ImmutableDictionary<string, string> properties) 170public ImmutableDictionary<string, string> Properties { get; }
Collections\CopyOnWritePropertyDictionary.cs (7)
42private static readonly ImmutableDictionary<string, T> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, T>(MSBuildNameIgnoreCaseComparer.Default); 47private ImmutableDictionary<string, T> _backing; 141public ImmutableDictionary<string, T>.Enumerator GetEnumerator() => _backing.GetEnumerator(); 170ImmutableDictionary<string, T> thisBacking = _backing; 171ImmutableDictionary<string, T> thatBacking = other._backing; 215ImmutableDictionary<string, T> thisBacking = _backing; 398private ImmutableDictionary<string, T>.Enumerator _dictionaryEnumerator;
CopyOnWriteDictionary.cs (11)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 301public ImmutableDictionary<string, V>.Enumerator GetEnumerator() 308ImmutableDictionary<string, V>.Enumerator enumerator = _backing.GetEnumerator(); 399ImmutableDictionary<string, V> snapshot = _backing;
Evaluation\LazyItemEvaluator.cs (2)
462private static readonly ImmutableDictionary<string, LazyItemList> s_emptyIgnoreCase = ImmutableDictionary.Create<string, LazyItemList>(StringComparer.OrdinalIgnoreCase); 468public ImmutableDictionary<string, LazyItemList>.Builder ReferencedItemLists { get; } = Traits.Instance.EscapeHatches.UseCaseSensitiveItemNames ?
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
22private readonly ImmutableDictionary<string, LazyItemList> _referencedItemLists;
Graph\GraphBuilder.cs (3)
265ImmutableDictionary<string, string>.Builder solutionGlobalPropertiesBuilder = ImmutableDictionary.CreateBuilder( 308Dictionary<string, ImmutableDictionary<string, string>> globalPropertiesForProjectConfiguration = new(StringComparer.OrdinalIgnoreCase); 328if (!globalPropertiesForProjectConfiguration.TryGetValue(projectConfiguration.FullName, out ImmutableDictionary<string, string> projectGlobalProperties))
Graph\GraphBuildRequestData.cs (1)
231return ImmutableDictionary<string, string?>.Empty;
Graph\GraphBuildResult.cs (1)
34ResultsByNode = ImmutableDictionary<ProjectGraphNode, BuildResult>.Empty;
Graph\ProjectInterpretation.cs (6)
322var newProperties = defaultParts.Properties; 345public ImmutableDictionary<string, string> Properties { get; } 346public ImmutableDictionary<string, string> AdditionalProperties { get; } 350ImmutableDictionary<string, string> properties, 351ImmutableDictionary<string, string> additionalProperties, 426return ImmutableDictionary<string, string>.Empty;
Microsoft.Build.BuildCheck.UnitTests (14)
EditorConfig_Tests.cs (14)
780var properties = config.GlobalSection.Properties; 859var properties = config.GlobalSection.Properties; 875var properties = config.GlobalSection.Properties; 886var properties = config.GlobalSection.Properties; 912var properties = config.GlobalSection.Properties; 924var properties = config.GlobalSection.Properties; 936var properties = config.GlobalSection.Properties; 951var properties = config.GlobalSection.Properties; 966var properties = config.GlobalSection.Properties; 979var properties = config.GlobalSection.Properties; 992var properties = config.GlobalSection.Properties; 1004var properties = config.GlobalSection.Properties; 1018var properties = config.GlobalSection.Properties; 1035var properties = config.GlobalSection.Properties;
Microsoft.Build.Engine.UnitTests (1)
Graph\GraphTestingUtilities.cs (1)
20public static readonly ImmutableDictionary<string, string> EmptyGlobalProperties = new Dictionary<string, string> { { PropertyNames.IsGraphBuild, "true" } }.ToImmutableDictionary();
Microsoft.Build.Framework (12)
ImmutableSegmentedDictionary`2.cs (3)
18/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 22/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 32/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
ProjectStartedEventArgs.cs (1)
255? ImmutableDictionary<string, string>.Empty
RoslynImmutableInterlocked.cs (8)
266/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 286/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 306/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 334/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 372/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 408/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 434/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 462/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
Microsoft.Build.Tasks.Core (11)
CopyOnWriteDictionary.cs (11)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 301public ImmutableDictionary<string, V>.Enumerator GetEnumerator() 308ImmutableDictionary<string, V>.Enumerator enumerator = _backing.GetEnumerator(); 399ImmutableDictionary<string, V> snapshot = _backing;
Microsoft.Build.Utilities.Core (11)
CopyOnWriteDictionary.cs (11)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 301public ImmutableDictionary<string, V>.Enumerator GetEnumerator() 308ImmutableDictionary<string, V>.Enumerator enumerator = _backing.GetEnumerator(); 399ImmutableDictionary<string, V> snapshot = _backing;
Microsoft.CodeAnalysis (231)
CodeGen\CompilationTestData.cs (3)
45private ImmutableDictionary<string, MethodData>? _lazyMethodsByName; 64public ImmutableDictionary<string, MethodData> GetMethodsByName() 81var methodsByName = map.Where(p => p.Value.Method != null).ToImmutableDictionary();
CommandLine\AnalyzerConfig.cs (2)
319public Section(string name, ImmutableDictionary<string, string> properties) 338public ImmutableDictionary<string, string> Properties { get; }
CommandLine\AnalyzerConfigOptionsResult.cs (6)
7using AnalyzerOptions = System.Collections.Immutable.ImmutableDictionary<string, string>; 8using TreeOptions = System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic>; 20public TreeOptions TreeOptions { get; } 25public AnalyzerOptions AnalyzerOptions { get; } 33TreeOptions treeOptions, 34AnalyzerOptions analyzerOptions,
CommandLine\AnalyzerConfigSet.cs (16)
19using AnalyzerOptions = System.Collections.Immutable.ImmutableDictionary<string, string>; 20using TreeOptions = System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic>; 54private readonly ObjectPool<TreeOptions.Builder> _treeOptionsPool = 55new ObjectPool<TreeOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, ReportDiagnostic>(Section.PropertiesKeyComparer)); 57private readonly ObjectPool<AnalyzerOptions.Builder> _analyzerOptionsPool = 58new ObjectPool<AnalyzerOptions.Builder>(() => ImmutableDictionary.CreateBuilder<string, string>(Section.PropertiesKeyComparer)); 395private static void ParseSectionOptions(Section section, TreeOptions.Builder treeBuilder, AnalyzerOptions.Builder analyzerBuilder, ArrayBuilder<Diagnostic> diagnosticBuilder, string analyzerConfigPath, ConcurrentDictionary<ReadOnlyMemory<char>, string> diagIdCache) 477private ImmutableDictionary<string, ImmutableDictionary<string, (string value, string configPath, int globalLevel)>.Builder>.Builder? _values; 478private ImmutableDictionary<string, ImmutableDictionary<string, (int globalLevel, ArrayBuilder<string> configPaths)>.Builder>.Builder? _duplicates; 487_values = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (string, string, int)>.Builder>(Section.NameEqualityComparer); 488_duplicates = ImmutableDictionary.CreateBuilder<string, ImmutableDictionary<string, (int, ArrayBuilder<string>)>.Builder>(Section.NameEqualityComparer); 516return new GlobalAnalyzerConfig(new Section(GlobalSectionName, AnalyzerOptions.Empty), ImmutableArray<Section>.Empty); 557var result = dict.ToImmutableDictionary(d => d.Key, d => d.Value.value, Section.PropertiesKeyComparer);
CommandLine\CommandLineParser.cs (1)
1425internal static ImmutableDictionary<string, string> ParseFeatures(List<string> features)
CommandLine\CommonCompiler.cs (2)
1027var options = sourceFileAnalyzerConfigOptions[i].AnalyzerOptions; 1042var options = additionalFileOptions[i].AnalyzerOptions;
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (2)
68public override ImmutableDictionary<string, string?> Properties => ImmutableDictionary<string, string?>.Empty;
Compilation\Compilation.cs (1)
120set = ImmutableDictionary<string, string>.Empty;
Compilation\CompilationOptions.cs (4)
195public ImmutableDictionary<string, ReportDiagnostic> SpecificDiagnosticOptions { get; protected set; } 283ImmutableDictionary<string, ReportDiagnostic> specificDiagnosticOptions, 390public CompilationOptions WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>? value) 541protected abstract CompilationOptions CommonWithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>? specificDiagnosticOptions);
Compilation\SyntaxTreeOptionsProvider.cs (2)
34public readonly ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions; 51private readonly ImmutableDictionary<SyntaxTree, Options> _options;
Diagnostic\Diagnostic.cs (13)
63/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 70ImmutableDictionary<string, string?>? properties, 110/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 118ImmutableDictionary<string, string?>? properties, 138/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 147ImmutableDictionary<string, string?>? properties, 192/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 209ImmutableDictionary<string, string?>? properties = null) 242/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 260ImmutableDictionary<string, string?>? properties = null) 407/// Gets property bag for the diagnostic. it will return <see cref="ImmutableDictionary{TKey, TValue}.Empty"/> 411public virtual ImmutableDictionary<string, string?> Properties 412=> ImmutableDictionary<string, string?>.Empty;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
81public override ImmutableDictionary<string, string?> Properties
Diagnostic\Diagnostic_SimpleDiagnostic.cs (6)
28private readonly ImmutableDictionary<string, string?> _properties; 38ImmutableDictionary<string, string?>? properties, 53_properties = properties ?? ImmutableDictionary<string, string?>.Empty; 64ImmutableDictionary<string, string?>? properties, 74ImmutableDictionary<string, string?>? properties, bool isSuppressed = false) 141public override ImmutableDictionary<string, string?> Properties
Diagnostic\DiagnosticInfo.cs (2)
34private static ImmutableDictionary<int, DiagnosticDescriptor> s_errorCodeToDescriptorMap = ImmutableDictionary<int, DiagnosticDescriptor>.Empty;
DiagnosticAnalyzer\AnalysisResult.cs (19)
24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 25ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 26ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics, 27ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 28ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analyzerTelemetryInfo) 46public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 51public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; } 56public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> AdditionalFileDiagnostics { get; } 61public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> CompilationDiagnostics { get; } 66public ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> AnalyzerTelemetryInfo { get; } 113ImmutableDictionary<T, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localDiagnostics, 133ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (20)
25private static readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> s_emptyPathToAdditionalTextMap = 26ImmutableDictionary<string, OneOrMany<AdditionalText>>.Empty.WithComparers(PathUtilities.Comparer); 35private readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> _pathToAdditionalTextMap; 64private static ImmutableDictionary<string, OneOrMany<AdditionalText>> CreatePathToAdditionalTextMap(ImmutableArray<AdditionalText> additionalFiles) 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 505ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics; 506ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics; 507ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics; 520var analyzerTelemetryInfo = GetTelemetryInfo(analyzers); 524private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> GetImmutable<TKey>( 532return ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>.Empty; 535var builder = ImmutableDictionary.CreateBuilder<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>(); 560private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> GetImmutable( 567return ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 586private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> GetTelemetryInfo(
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
1064ImmutableDictionary<Diagnostic, ProgrammaticSuppressionInfo> programmaticSuppressionsByDiagnostic = createProgrammaticSuppressionsByDiagnosticMap(_programmaticSuppressions); 1150static ImmutableDictionary<Diagnostic, ProgrammaticSuppressionInfo> createProgrammaticSuppressionsByDiagnosticMap(ConcurrentSet<Suppression> programmaticSuppressions) 1448internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes;
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
180internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
378private ImmutableDictionary<string, ImmutableArray<TExtension>> _lazyExtensionsPerLanguage; 389_lazyExtensionsPerLanguage = ImmutableDictionary<string, ImmutableArray<TExtension>>.Empty;
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (2)
25private static ImmutableDictionary<LocalizableString, Exception?> s_localizableStringToException = ImmutableDictionary<LocalizableString, Exception?>.Empty.WithComparers(ReferenceEqualityComparer.Instance);
DiagnosticAnalyzer\AnalyzerManager.cs (1)
358var diagnosticOptions = options.SpecificDiagnosticOptions;
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (3)
735(var analyzerActionCounts, var hasAnyActionsRequiringCompilationEvents) = await getAnalyzerActionCountsAsync( 830static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync( 855ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts)
DiagnosticAnalyzer\CompilerAnalyzerConfigOptionsProvider.cs (4)
11private readonly ImmutableDictionary<object, AnalyzerConfigOptions> _treeDict; 15ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, 19ImmutableDictionary<object, AnalyzerConfigOptions> treeDict, 34internal CompilerAnalyzerConfigOptionsProvider WithAdditionalTreeOptions(ImmutableDictionary<object, AnalyzerConfigOptions> treeDict)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (8)
17private static readonly ImmutableDictionary<string, string?> s_syntactic = ImmutableDictionary<string, string?>.Empty.Add(Origin, Syntactic); 18private static readonly ImmutableDictionary<string, string?> s_declaration = ImmutableDictionary<string, string?>.Empty.Add(Origin, Declaration); 63ImmutableDictionary<string, string?>? properties = null) 79private readonly ImmutableDictionary<string, string?> _properties; 81public CompilerDiagnostic(Diagnostic original, ImmutableDictionary<string, string?> properties) 100public override ImmutableDictionary<string, string?> Properties => _properties;
DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (5)
36private readonly ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>> _localSuppressionsBySymbol; 108_localSuppressionsBySymbol = new ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>>(); 221var suppressions = _localSuppressionsBySymbol.GetOrAdd(symbol, this.DecodeLocalSuppressMessageAttributes); 277private ImmutableDictionary<string, SuppressMessageInfo> DecodeLocalSuppressMessageAttributes(ISymbol symbol) 283private static ImmutableDictionary<string, SuppressMessageInfo> DecodeLocalSuppressMessageAttributes(IEnumerable<AttributeData> attributes)
Emit\CommonPEModuleBuilder.cs (2)
162internal abstract ImmutableDictionary<ISymbolInternal, ImmutableArray<ISymbolInternal>> GetAllSynthesizedMembers(); 1047internal override ImmutableDictionary<ISymbolInternal, ImmutableArray<ISymbolInternal>> GetAllSynthesizedMembers()
Emit\EditAndContinue\DefinitionMap.cs (3)
41private readonly ImmutableDictionary<IMethodSymbolInternal, MethodInstrumentation> _methodInstrumentations; 47private ImmutableDictionary<INamedTypeSymbolInternal, MetadataLambdasAndClosures> _metadataLambdasAndClosures 48= ImmutableDictionary<INamedTypeSymbolInternal, MetadataLambdasAndClosures>.Empty;
Emit\EditAndContinue\EmitBaseline.cs (2)
70ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap) 79public readonly ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> AssemblyReferenceIdentityMap = assemblyReferenceIdentityMap;
InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (3)
17private readonly ImmutableDictionary<T, uint> _map; 20private ImmutableSetWithInsertionOrder(ImmutableDictionary<T, uint> map, uint nextElementValue) 49var modifiedMap = _map.Remove(value);
Operations\ControlFlowGraph.cs (4)
27private readonly ImmutableDictionary<IMethodSymbol, (ControlFlowRegion region, ILocalFunctionOperation operation, int ordinal)> _localFunctionsMap; 29private readonly ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)> _anonymousFunctionsMap; 37ImmutableDictionary<IMethodSymbol, (ControlFlowRegion region, ILocalFunctionOperation operation, int ordinal)> localFunctionsMap, 38ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)> anonymousFunctionsMap)
Operations\ControlFlowGraphBuilder.cs (2)
151ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion, int)>.Builder? anonymousFunctionsMapOpt = null; 169anonymousFunctionsMapOpt?.ToImmutable() ?? ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion, int)>.Empty);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (7)
298ImmutableDictionary<IMethodSymbol, (ControlFlowRegion region, ILocalFunctionOperation operation, int ordinal)>.Builder localFunctionsMap, 299ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder? anonymousFunctionsMapOpt, 383(ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder map, ControlFlowRegion region) argument = (anonymousFunctionsMapOpt, result); 399OperationVisitor<(ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder map, ControlFlowRegion region), IOperation> 405(ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder map, ControlFlowRegion region) argument) 411internal override IOperation? VisitNoneOperation(IOperation operation, (ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder map, ControlFlowRegion region) argument) 418(ImmutableDictionary<IFlowAnonymousFunctionOperation, (ControlFlowRegion region, int ordinal)>.Builder map, ControlFlowRegion region) argument)
ReferenceManager\CommonReferenceManager.Binding.cs (3)
105ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 222ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 527ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
ReferenceManager\CommonReferenceManager.State.cs (10)
48internal abstract ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions { get; } 132private ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>? _lazyImplicitReferenceResolutions; 188private ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>>? _lazyMergedAssemblyReferencesMap; 259internal override ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions 324internal ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>> MergedAssemblyReferencesMap 414ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions, 444_lazyMergedAssemblyReferencesMap = mergedAssemblyReferencesMapOpt?.ToImmutableDictionary() ?? ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>>.Empty; 542internal static ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> GetAssemblyReferenceIdentityBaselineMap(ImmutableArray<TAssemblySymbol> symbols, ImmutableArray<AssemblyIdentity> originalIdentities) 546ImmutableDictionary<AssemblyIdentity, AssemblyIdentity>.Builder? lazyBuilder = null; 576return lazyBuilder?.ToImmutable() ?? ImmutableDictionary<AssemblyIdentity, AssemblyIdentity>.Empty;
RuleSet\RuleSet.cs (4)
38private readonly ImmutableDictionary<string, ReportDiagnostic> _specificDiagnosticOptions; 42public ImmutableDictionary<string, ReportDiagnostic> SpecificDiagnosticOptions 59public RuleSet(string filePath, ReportDiagnostic generalOption, ImmutableDictionary<string, ReportDiagnostic> specificOptions, ImmutableArray<RuleSetInclude> includes) 63_specificDiagnosticOptions = specificOptions == null ? ImmutableDictionary<string, ReportDiagnostic>.Empty : specificOptions;
SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
SourceGeneration\GeneratorDriver.cs (1)
325(var sources, var generatorDiagnostics, var generatorRunStateTable, var hostOutputs) = context.ToImmutableAndFree();
SourceGeneration\GeneratorState.cs (18)
26ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 27ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 28ImmutableDictionary<string, object>.Empty, 41ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 42ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 43ImmutableDictionary<string, object>.Empty, 55ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> executedSteps, 56ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> outputSteps, 57ImmutableDictionary<string, object> hostOutputs, 76ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> executedSteps, 77ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> outputSteps, 78ImmutableDictionary<string, object> hostOutputs, 100ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 101ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty, 102ImmutableDictionary<string, object>.Empty, 123internal ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> ExecutedSteps { get; } 125internal ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> OutputSteps { get; } 127internal ImmutableDictionary<string, object> HostOutputs { get; }
SourceGeneration\IncrementalContexts.cs (2)
268internal readonly ImmutableDictionary<string, object>.Builder HostOutputBuilder; 279internal (ImmutableArray<GeneratedSourceText> sources, ImmutableArray<Diagnostic> diagnostics, GeneratorRunStateTable executedSteps, ImmutableDictionary<string, object> hostOutputs) ToImmutableAndFree()
SourceGeneration\Nodes\GeneratorRunStateTable.cs (7)
15private GeneratorRunStateTable(ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> executedSteps, ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> outputSteps) 21public ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> ExecutedSteps { get; } 23public ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> OutputSteps { get; } 57private static ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> StepCollectionToImmutable(Dictionary<string, HashSet<IncrementalGeneratorRunStep>>? builder) 61return ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Empty; 64ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>>.Builder resultBuilder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<IncrementalGeneratorRunStep>>();
SourceGeneration\RunResults.cs (6)
85ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> namedSteps, 86ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> outputSteps, 87ImmutableDictionary<string, object> hostOutputs, 128public ImmutableDictionary<string, object> HostOutputs { get; } 151public ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> TrackedSteps { get; } 159public ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> TrackedOutputSteps { get; }
SourceGeneration\SyntaxStore.cs (2)
31private readonly ImmutableDictionary<SyntaxInputNode, Exception>.Builder _syntaxExceptions = ImmutableDictionary.CreateBuilder<SyntaxInputNode, Exception>(); 32private readonly ImmutableDictionary<SyntaxInputNode, TimeSpan>.Builder _syntaxTimes = ImmutableDictionary.CreateBuilder<SyntaxInputNode, TimeSpan>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Syntax\AbstractWarningStateMap.cs (2)
73public readonly ImmutableDictionary<string, TWarningState> SpecificWarningOption; 82public WarningStateMapEntry(int position, TWarningState general, ImmutableDictionary<string, TWarningState> specific)
Syntax\SyntaxTree.cs (3)
27protected internal static readonly ImmutableDictionary<string, ReportDiagnostic> EmptyDiagnosticOptions = 84public virtual ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions => EmptyDiagnosticOptions; 407public virtual SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Microsoft.CodeAnalysis.Analyzers (143)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (6)
70private static readonly ImmutableDictionary<string, string?> s_EqualityRuleProperties = 73private static readonly ImmutableDictionary<string, string?> s_GetHashCodeRuleProperties = 76private static readonly ImmutableDictionary<string, string?> s_CollectionRuleProperties = 103var equalityComparerMethods = GetEqualityComparerMethodsToCheck(compilation); 170ImmutableDictionary<string, ImmutableHashSet<INamedTypeSymbol>> equalityComparerMethods, 326private static ImmutableDictionary<string, ImmutableHashSet<INamedTypeSymbol>> GetEqualityComparerMethodsToCheck(Compilation compilation)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (5)
32using PooledResourcesDataValueConcurrentDictionary = PooledConcurrentDictionary<string, ImmutableDictionary<string, (string value, Location location)>>; 225out ImmutableDictionary<string, ImmutableArray<(string? prefix, int start, int end)>>? categoryAndAllowedIdsMap, 675var properties = ImmutableDictionary<string, string?>.Empty.Add(DefineDescriptorArgumentCorrectlyFixValue, fixValue); 852var map = GetOrCreateResourceMap(options, resourceFileName, resourceDataValueMap, cancellationToken);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (3)
141ImmutableDictionary<string, ImmutableArray<(string? prefix, int start, int end)>>? categoryAndAllowedIdsInfoMap, 198[NotNullWhen(returnValue: true)] out ImmutableDictionary<string, ImmutableArray<(string? prefix, int start, int end)>>? categoryAndAllowedIdsMap, 231[NotNullWhen(returnValue: true)] out ImmutableDictionary<string, ImmutableArray<(string? prefix, int start, int end)>>? categoryAndAllowedIdsInfoMap,
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (4)
289var properties = ImmutableDictionary<string, string?>.Empty.Add( 326var properties = ImmutableDictionary<string, string?>.Empty.Add(propertyName, newEntry);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (6)
19using PooledResourcesDataValueConcurrentDictionary = PooledConcurrentDictionary<string, ImmutableDictionary<string, (string value, Location location)>>; 36private static ImmutableDictionary<string, (string value, Location location)> GetOrCreateResourceMap( 46if (resourceMap.TryGetValue(resourceFileName, out var map)) 55private static ImmutableDictionary<string, (string value, Location location)> CreateResourceMap(AnalyzerOptions options, string resourceFileName, CancellationToken cancellationToken) 66return ImmutableDictionary<string, (string value, Location location)>.Empty; 68static ImmutableDictionary<string, (string value, Location location)> CreateResourceMapForFile(AdditionalText file, CancellationToken cancellationToken)
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (2)
119private ImmutableDictionary<INamedTypeSymbol, ImmutableArray<IFieldSymbol>> _supportedDescriptorFieldsMap; 127_supportedDescriptorFieldsMap = ImmutableDictionary<INamedTypeSymbol, ImmutableArray<IFieldSymbol>>.Empty;
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Microsoft.CodeAnalysis.Analyzers.UnitTests (4)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzerTests.cs (2)
4468private static readonly ImmutableDictionary<string, ReportDiagnostic> s_enableReleaseTrackingWarningDisabled = ImmutableDictionary<string, ReportDiagnostic>.Empty
MetaAnalyzers\ReleaseTrackingAnalyzerTests.cs (2)
1029private static readonly ImmutableDictionary<string, ReportDiagnostic> s_nonReleaseTrackingWarningsDisabled = ImmutableDictionary<string, ReportDiagnostic>.Empty
Microsoft.CodeAnalysis.AnalyzerUtilities (224)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
576ImmutableDictionary<IParameterSymbol, ArgumentInfo<CopyAbstractValue>> argumentValuesMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyBlockAnalysisResult.cs (2)
18Data = blockAnalysisData?.CoreAnalysisData.ToImmutableDictionary() ?? ImmutableDictionary<AnalysisEntity, CopyAbstractValue>.Empty; 22public ImmutableDictionary<AnalysisEntity, CopyAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.cs (1)
127var trackedInstanceFieldPointsToMap = analysisContext.TrackInstanceFields ?
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
47public ImmutableDictionary<IFieldSymbol, PointsToAbstractValue> TrackedInstanceFieldPointsToMap
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisResult.cs (2)
16ImmutableDictionary<IFieldSymbol, PointsToAnalysis.PointsToAbstractValue>? trackedInstanceFieldPointsToMap) 22public ImmutableDictionary<IFieldSymbol, PointsToAnalysis.PointsToAbstractValue>? TrackedInstanceFieldPointsToMap { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeBlockAnalysisResult.cs (2)
20Data = blockAnalysisData?.ToImmutableDictionary() ?? ImmutableDictionary<AbstractLocation, DisposeAbstractValue>.Empty; 23public ImmutableDictionary<AbstractLocation, DisposeAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateBlockAnalysisResult.cs (2)
20Data = blockAnalysisData?.ToImmutableDictionary() ?? ImmutableDictionary<AnalysisEntity, GlobalFlowStateAnalysisValueSet>.Empty; 23public ImmutableDictionary<AnalysisEntity, GlobalFlowStateAnalysisValueSet> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateDataFlowOperationVisitor.cs (3)
30private readonly ImmutableDictionary<IOperation, TAbstractAnalysisValue>.Builder _globalValuesMapBuilder; 45internal ImmutableDictionary<IOperation, TAbstractAnalysisValue> GetGlobalValuesMap() 149ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> argumentValuesMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.cs (4)
30public static ImmutableDictionary<IParameterSymbol, SyntaxNode> GetOrComputeHazardousParameterUsages( 46return ImmutableDictionary<IParameterSymbol, SyntaxNode>.Empty; 58private static ImmutableDictionary<IParameterSymbol, SyntaxNode> GetOrComputeHazardousParameterUsages( 82return ImmutableDictionary<IParameterSymbol, SyntaxNode>.Empty;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (4)
28private readonly ImmutableDictionary<IParameterSymbol, SyntaxNode>.Builder? _hazardousParameterUsageBuilder; 45public ImmutableDictionary<IParameterSymbol, SyntaxNode> HazardousParameterUsages 321var hazardousParameterUsagesInInvokedMethod = invokedMethodAnalysisResult.HazardousParameterUsages; 367var hazardousParameterUsagesInInvokedMethod = invokedMethodAnalysisResult.HazardousParameterUsages;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysisResult.cs (2)
16ImmutableDictionary<IParameterSymbol, SyntaxNode> hazardousParameterUsages) 22public ImmutableDictionary<IParameterSymbol, SyntaxNode> HazardousParameterUsages { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationBlockAnalysisResult.cs (2)
20Data = blockAnalysisData?.ToImmutableDictionary() ?? ImmutableDictionary<AbstractLocation, ParameterValidationAbstractValue>.Empty; 23public ImmutableDictionary<AbstractLocation, ParameterValidationAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\DefaultPointsToValueGenerator.cs (1)
17private readonly ImmutableDictionary<AnalysisEntity, PointsToAbstractValue>.Builder _defaultPointsToValueMapBuilder;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (6)
53public ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> GetEscapedLocationsThroughOperationsMap() 56public ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> GetEscapedLocationsThroughReturnValuesMap() 59public ImmutableDictionary<AnalysisEntity, ImmutableHashSet<AbstractLocation>> GetEscapedLocationsThroughEntitiesMap() 62private static ImmutableDictionary<T, ImmutableHashSet<AbstractLocation>> GetEscapedAbstractLocationsMapAndFreeBuilder<T>( 70return ImmutableDictionary<T, ImmutableHashSet<AbstractLocation>>.Empty; 612ImmutableDictionary<IParameterSymbol, ArgumentInfo<PointsToAbstractValue>> argumentValuesMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisResult.cs (7)
14private readonly ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> _escapedLocationsThroughOperationsMap; 15private readonly ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> _escapedLocationsThroughReturnValuesMap; 16private readonly ImmutableDictionary<AnalysisEntity, ImmutableHashSet<AbstractLocation>> _escapedLocationsThroughEntitiesMap; 22ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> escapedLocationsThroughOperationsMap, 23ImmutableDictionary<IOperation, ImmutableHashSet<AbstractLocation>> escapedLocationsThroughReturnValuesMap, 24ImmutableDictionary<AnalysisEntity, ImmutableHashSet<AbstractLocation>> escapedLocationsThroughEntitiesMap, 47ImmutableDictionary<TKey, ImmutableHashSet<AbstractLocation>> map)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToBlockAnalysisResult.cs (2)
18Data = blockAnalysisData?.CoreAnalysisData.ToImmutableDictionary() ?? ImmutableDictionary<AnalysisEntity, PointsToAbstractValue>.Empty; 22public ImmutableDictionary<AnalysisEntity, PointsToAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\HazardousUsageEvaluatorCollection.cs (2)
49private ImmutableDictionary<(HazardousUsageEvaluatorKind Kind, string? InstanceTypeName, string? MethodName, string? ParameterName, bool DerivedClasses), HazardousUsageEvaluator> HazardousUsageEvaluators { get; } 104internal ImmutableDictionary<(INamedTypeSymbol, bool), string> GetTypeToNameMapping(WellKnownTypeProvider wellKnownTypeProvider)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertyMapperCollection.cs (2)
58ImmutableDictionary<string, (int Index, PropertyMapper PropertyMapper)>.Builder builder = ImmutableDictionary.CreateBuilder<string, (int Index, PropertyMapper PropertyMapper)>(StringComparer.Ordinal); 80private ImmutableDictionary<string, (int Index, PropertyMapper PropertyMapper)> PropertyMappersWithIndex { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (2)
38private readonly ImmutableDictionary<(Location Location, IMethodSymbol? Method), HazardousUsageEvaluationResult>.Builder _hazardousUsageBuilder; 86public ImmutableDictionary<(Location Location, IMethodSymbol? Method), HazardousUsageEvaluationResult> HazardousUsages => this._hazardousUsageBuilder.ToImmutable();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisContext.cs (2)
45ImmutableDictionary<(INamedTypeSymbol, bool), string> hazardousUsageTypesToNames) 158public ImmutableDictionary<(INamedTypeSymbol, bool), string> HazardousUsageTypesToNames { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisResult.cs (2)
19ImmutableDictionary<(Location Location, IMethodSymbol? Method), HazardousUsageEvaluationResult> hazardousUsages, 30public ImmutableDictionary<(Location Location, IMethodSymbol? Method), HazardousUsageEvaluationResult> HazardousUsages { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetBlockAnalysisResult.cs (2)
22Data = blockAnalysisData?.ToImmutableDictionary() ?? ImmutableDictionary<AbstractLocation, PropertySetAbstractValue>.Empty; 25public ImmutableDictionary<AbstractLocation, PropertySetAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\PooledHashSetExtensions.cs (1)
55?? ImmutableDictionary<string, ImmutableHashSet<string>>.Empty);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\SinkInfo.cs (2)
18public SinkInfo(string fullTypeName, ImmutableHashSet<SinkKind> sinkKinds, bool isInterface, bool isAnyStringParameterInConstructorASink, ImmutableHashSet<string> sinkProperties, ImmutableDictionary<string, ImmutableHashSet<string>> sinkMethodParameters) 56public ImmutableDictionary<string, ImmutableHashSet<string>> SinkMethodParameters { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataBlockAnalysisResult.cs (2)
16public ImmutableDictionary<AnalysisEntity, TaintedDataAbstractValue> Data { get; } 21Data = blockAnalysisData?.CoreAnalysisData.ToImmutableDictionary() ?? ImmutableDictionary<AnalysisEntity, TaintedDataAbstractValue>.Empty;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataConfig.cs (10)
33private static ImmutableDictionary<SinkKind, ImmutableHashSet<SourceInfo>> s_sinkKindToSourceInfo 39private static ImmutableDictionary<SinkKind, ImmutableHashSet<SanitizerInfo>> s_sinkKindToSanitizerInfo 45private static ImmutableDictionary<SinkKind, bool> s_sinkKindHasTaintArraySource 58private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SourceInfo>>> SourceSymbolMap { get; } 63private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SanitizerInfo>>> SanitizerSymbolMap { get; } 68private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SinkInfo>>> SinkSymbolMap { get; } 82ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SourceInfo>>> sourceSymbolMap, 83ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SanitizerInfo>>> sanitizerSymbolMap, 84ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SinkInfo>>> sinkSymbolMap) 191private TaintedDataSymbolMap<T> GetFromMap<T>(SinkKind sinkKind, ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<T>>> map)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (4)
46ImmutableDictionary<ITypeSymbol, TInfo>.Builder concreteInfosBuilder = ImmutableDictionary.CreateBuilder<ITypeSymbol, TInfo>(); 47ImmutableDictionary<ITypeSymbol, TInfo>.Builder interfaceInfosBuilder = ImmutableDictionary.CreateBuilder<ITypeSymbol, TInfo>(); 86private ImmutableDictionary<ITypeSymbol, TInfo> ConcreteInfos { get; } 91private ImmutableDictionary<ITypeSymbol, TInfo> InterfaceInfos { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentBlockAnalysisResult.cs (2)
18Data = blockAnalysisData?.CoreAnalysisData.ToImmutableDictionary() ?? ImmutableDictionary<AnalysisEntity, ValueContentAbstractValue>.Empty; 22public ImmutableDictionary<AnalysisEntity, ValueContentAbstractValue> Data { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocationDataFlowOperationVisitor.cs (1)
134=> GetClonedAnalysisDataHelper(ImmutableDictionary<AbstractLocation, TAbstractAnalysisValue>.Empty);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AddressSharedEntitiesProvider.cs (3)
27private readonly ImmutableDictionary<AnalysisEntity, CopyAbstractValue>.Builder _addressSharedEntitiesBuilder; 35public void SetAddressSharedEntities(ImmutableDictionary<AnalysisEntity, CopyAbstractValue>? addressSharedEntities) 107public ImmutableDictionary<AnalysisEntity, CopyAbstractValue> GetAddressedSharedEntityMap()
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (2)
172protected sealed override void StopTrackingDataForParameters(ImmutableDictionary<IParameterSymbol, AnalysisEntity> parameterEntities) 468ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> argumentValuesMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (1)
53ImmutableDictionary<ISymbol, PointsToAbstractValue>? interproceduralCapturedVariablesMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (11)
25private readonly ImmutableDictionary<BasicBlock, TBlockAnalysisResult> _basicBlockStateMap; 26private readonly ImmutableDictionary<IOperation, TAbstractAnalysisValue> _operationStateMap; 27private readonly ImmutableDictionary<IOperation, PredicateValueKind> _predicateValueKindMap; 28private readonly ImmutableDictionary<IOperation, IDataFlowAnalysisResult<TAbstractAnalysisValue>> _interproceduralResultsMap; 29private readonly ImmutableDictionary<IMethodSymbol, IDataFlowAnalysisResult<TAbstractAnalysisValue>> _standaloneLocalFunctionAnalysisResultsMap; 34ImmutableDictionary<BasicBlock, TBlockAnalysisResult> basicBlockStateMap, 35ImmutableDictionary<IOperation, TAbstractAnalysisValue> operationStateMap, 36ImmutableDictionary<IOperation, PredicateValueKind> predicateValueKindMap, 38ImmutableDictionary<IOperation, IDataFlowAnalysisResult<TAbstractAnalysisValue>> interproceduralResultsMap, 39ImmutableDictionary<IMethodSymbol, IDataFlowAnalysisResult<TAbstractAnalysisValue>> standaloneLocalFunctionAnalysisResultsMap, 87internal DataFlowAnalysisResult<TBlockAnalysisResult, TAbstractAnalysisValue> With(ImmutableDictionary<IOperation, TAbstractAnalysisValue> operationStateMap)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResultBuilder.cs (4)
46ImmutableDictionary<IOperation, TAbstractAnalysisValue> stateMap, 47ImmutableDictionary<IOperation, PredicateValueKind> predicateValueKindMap, 49ImmutableDictionary<IOperation, IDataFlowAnalysisResult<TAbstractAnalysisValue>> interproceduralResultsMap, 50ImmutableDictionary<IMethodSymbol, IDataFlowAnalysisResult<TAbstractAnalysisValue>> standaloneLocalFunctionAnalysisResultsMap,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (26)
47private readonly ImmutableDictionary<IOperation, TAbstractAnalysisValue>.Builder _valueCacheBuilder; 48private readonly ImmutableDictionary<IOperation, PredicateValueKind>.Builder _predicateValueKindCacheBuilder; 54private ImmutableDictionary<IParameterSymbol, AnalysisEntity>? _lazyParameterEntities; 118private readonly ImmutableDictionary<IOperation, IDataFlowAnalysisResult<TAbstractAnalysisValue>>.Builder _interproceduralResultsBuilder; 123private readonly ImmutableDictionary<IMethodSymbol, IDataFlowAnalysisResult<TAbstractAnalysisValue>>.Builder _standaloneLocalFunctionAnalysisResultsBuilder; 152public ImmutableDictionary<IOperation, IDataFlowAnalysisResult<TAbstractAnalysisValue>> InterproceduralResultsMap => _interproceduralResultsBuilder.ToImmutable(); 153public ImmutableDictionary<IMethodSymbol, IDataFlowAnalysisResult<TAbstractAnalysisValue>> StandaloneLocalFunctionAnalysisResultsMap => _standaloneLocalFunctionAnalysisResultsBuilder.ToImmutable(); 537protected virtual void StopTrackingDataForParameters(ImmutableDictionary<IParameterSymbol, AnalysisEntity> parameterEntities) 558var argumentValuesMap = DataFlowAnalysisContext.InterproceduralAnalysisData?.ArgumentValuesMap ?? 559ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>>.Empty; 1019internal ImmutableDictionary<IOperation, TAbstractAnalysisValue> GetStateMap() => _valueCacheBuilder.ToImmutable(); 1021internal ImmutableDictionary<IOperation, PredicateValueKind> GetPredicateValueKindMap() => _predicateValueKindCacheBuilder.ToImmutable(); 1157var outputData = DataFlowAnalysisContext.PointsToAnalysisResult.EntryBlockOutput.Data; 1164var inputData = DataFlowAnalysisContext.PointsToAnalysisResult[CurrentBasicBlock].Data; 1178var inputData = DataFlowAnalysisContext.PointsToAnalysisResult.MergedStateForUnhandledThrowOperations?.Data; 2130ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> argumentValuesMap, 2437var argumentValuesMap = GetArgumentValues(ref invocationInstance); 2438var pointsToValues = pointsToAnalysisResult?[cfg.GetEntry()].Data; 2439var copyValues = copyAnalysisResult?[cfg.GetEntry()].Data; 2440var valueContentValues = valueContentAnalysisResult?[cfg.GetEntry()].Data; 2499ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> GetArgumentValues(ref (AnalysisEntity? entity, PointsToAbstractValue pointsToValue)? invocationInstance) 2594private ImmutableDictionary<ISymbol, PointsToAbstractValue> GetCapturedVariablesMap( 2603return ImmutableDictionary<ISymbol, PointsToAbstractValue>.Empty; 2609return ImmutableDictionary<ISymbol, PointsToAbstractValue>.Empty; 2745argumentValuesMap: ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>>.Empty, 2747addressSharedEntities: ImmutableDictionary<AnalysisEntity, CopyAbstractValue>.Empty,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (1)
33public ImmutableDictionary<TKey, TValue> ToImmutableDictionary()
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\InterproceduralAnalysisData.cs (6)
33ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> argumentValuesMap, 34ImmutableDictionary<ISymbol, PointsToAbstractValue> capturedVariablesMap, 35ImmutableDictionary<AnalysisEntity, CopyAbstractValue> addressSharedEntities, 60public ImmutableDictionary<IParameterSymbol, ArgumentInfo<TAbstractAnalysisValue>> ArgumentValuesMap { get; } 61public ImmutableDictionary<ISymbol, PointsToAbstractValue> CapturedVariablesMap { get; } 62public ImmutableDictionary<AnalysisEntity, CopyAbstractValue> AddressSharedEntities { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Microsoft.CodeAnalysis.BannedApiAnalyzers (122)
RestrictedInternalsVisibleToAnalyzer.cs (5)
58var restrictedInternalsVisibleToMap = GetRestrictedInternalsVisibleToMap(compilationContext.Compilation); 117private static ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> GetRestrictedInternalsVisibleToMap(Compilation compilation) 122return ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>>.Empty; 190ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> restrictedInternalsVisibleToMap, 206ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> restrictedInternalsVisibleToMap,
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Microsoft.CodeAnalysis.CodeStyle (121)
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (2)
33protected static readonly ImmutableDictionary<string, string?> ModifiersAddedProperties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (5)
25private static readonly Dictionary<(bool includeInFixAll, string equivalenceKey), ImmutableDictionary<string, string?>> s_cachedProperties = []; 37var properties = ImmutableDictionary<string, string?>.Empty; 70private static ImmutableDictionary<string, string?> GetProperties(bool includeInFixAll, string equivalenceKey) 172var properties = GetProperties(includeInFixAll, equivalenceKey);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
25public static readonly ImmutableDictionary<string, string?> s_isFixableProperties = 26ImmutableDictionary<string, string?>.Empty.Add(ForEachCastHelpers.IsFixable, ForEachCastHelpers.IsFixable);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (14)
35/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 45ImmutableDictionary<string, string?>? properties, 116return CreateWithMessage(descriptor, location, notificationOption, analyzerOptions, additionalLocations, ImmutableDictionary<string, string?>.Empty, message); 118var tagIndices = ImmutableDictionary<string, IEnumerable<int>>.Empty 128ImmutableDictionary<string, string?>.Empty); 162ImmutableDictionary<string, string?>? properties, 184ImmutableDictionary<string, string?>? properties) 189var tagIndices = ImmutableDictionary<string, IEnumerable<int>>.Empty 210ImmutableDictionary<string, string?>? properties) 215properties ??= ImmutableDictionary<string, string?>.Empty; 250/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 260ImmutableDictionary<string, string?>? properties,
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
88properties: ImmutableDictionary<string, string?>.Empty.Add(MatchFolderAndNamespaceConstants.TargetNamespace, targetNamespace),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
69var properties = ImmutableDictionary<string, string?>.Empty
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (2)
99var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
466if (analysisResult.SyntaxDiagnostics.TryGetValue(semanticModel.SyntaxTree, out var diagnostics)) 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (2)
20private static readonly ImmutableDictionary<string, TargetScope> s_targetScopesMap = CreateTargetScopesMap(); 25private static ImmutableDictionary<string, TargetScope> CreateTargetScopesMap()
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (5)
19using PropertiesMap = ImmutableDictionary<(UnusedValuePreference preference, bool isUnusedLocalAssignment, bool isRemovableAssignment), 20ImmutableDictionary<string, string?>>; 93private static readonly PropertiesMap s_propertiesMap = CreatePropertiesMap(); 148private static PropertiesMap CreatePropertiesMap() 151ImmutableDictionary<string, string?>>();
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
214var properties = s_propertiesMap[(_options.UnusedValueExpressionStatementPreference, isUnusedLocalAssignment: false, isRemovableAssignment: false)]; 571if (ShouldReportUnusedValueDiagnostic(symbol, unreadWriteOperation, symbolUsageResult, out var properties)) 592out ImmutableDictionary<string, string?>? properties)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (9)
25private static readonly ImmutableDictionary<string, string?> s_takeCondition 26= ImmutableDictionary<string, string?>.Empty; 27private static readonly ImmutableDictionary<string, string?> s_negateCondition 29private static readonly ImmutableDictionary<string, string?> s_takeConditionOrWhenFalse 31private static readonly ImmutableDictionary<string, string?> s_negateConditionAndWhenFalse 33private static readonly ImmutableDictionary<string, string?> s_negateConditionOrWhenTrue 35private static readonly ImmutableDictionary<string, string?> s_takeConditionAndWhenTrue 37private static readonly ImmutableDictionary<string, string?> s_takeConditionAndWhenFalse 138void ReportDiagnostic(ImmutableDictionary<string, string?> properties)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
652var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (3)
182var properties = shouldUseCollectionExpression ? UseCollectionInitializerHelpers.UseCollectionExpressionProperties : ImmutableDictionary<string, string?>.Empty; 243ImmutableDictionary<string, string?>? properties)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (2)
19public static readonly ImmutableDictionary<string, string?> UseCollectionExpressionProperties = 20ImmutableDictionary<string, string?>.Empty.Add(UseCollectionExpressionName, UseCollectionExpressionName);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
29private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _binaryToAssignmentMap;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
21out ImmutableDictionary<TSyntaxKind, TSyntaxKind> binaryToAssignmentMap, 22out ImmutableDictionary<TSyntaxKind, TSyntaxKind> assignmentToTokenMap) where TSyntaxKind : struct
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (2)
20public static readonly ImmutableDictionary<string, string?> CanSimplifyProperties = 21ImmutableDictionary<string, string?>.Empty.Add(CanSimplifyName, CanSimplifyName);
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
61var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
107var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
66private static readonly ImmutableDictionary<string, string?> s_whenPartIsNullableProperties = 67ImmutableDictionary<string, string?>.Empty.Add(UseNullPropagationHelpers.WhenPartIsNullable, ""); 192var properties = whenPartIsNullable 194: ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (2)
119var properties = whenPartIsNullable 121: ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
85ImmutableDictionary<string, string?>.Empty));
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Microsoft.CodeAnalysis.CodeStyle.Fixes (39)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
49private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 51public ImmutableDictionary<string, string> ParameterToNewFieldMap { get; private set; } 52public ImmutableDictionary<string, string> ParameterToNewPropertyMap { get; private set; } 61ParameterToNewFieldMap = ImmutableDictionary<string, string>.Empty; 62ParameterToNewPropertyMap = ImmutableDictionary<string, string>.Empty; 484var newMemberMap = 487ImmutableDictionary<string, string>.Empty;
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (3)
132ImmutableDictionary<string, ISymbol> parameterToExistingMemberMap, 133ImmutableDictionary<string, string> parameterToNewFieldMap, 134ImmutableDictionary<string, string> parameterToNewPropertyMap)> GetParametersAsync<TExpressionSyntax>(
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
56var properties = diagnostic.Properties;
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
33ImmutableDictionary<string, string?> properties,
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
64ImmutableDictionary<string, string?> properties,
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
28private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _binaryToAssignmentMap; 29private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _assignmentToTokenMap;
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
67ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (3)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs (3)
22internal static ImmutableDictionary<string, ReportDiagnostic> NullableWarnings { get; } = GetNullableWarningsFromCompiler(); 24private static ImmutableDictionary<string, ReportDiagnostic> GetNullableWarningsFromCompiler() 28var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions;
Microsoft.CodeAnalysis.Collections.Package (16)
Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.CSharp (204)
Binder\Binder_Lookup.cs (3)
447protected bool IsUsingAlias(ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, string name, bool callerIsSemanticModel) 472ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, 2009ImmutableDictionary<string, AliasAndUsingDirective> usingAliases,
Binder\DecisionDagBuilder.cs (16)
828DagState uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 887ImmutableDictionary<BoundDagTemp, IValueSet>.Empty); 950out var whenTrueDecisions, out var whenTrueValues, 951out var whenFalseDecisions, out var whenFalseValues, 1088out ImmutableDictionary<BoundDagTemp, IValueSet> whenTrueValues, 1090out ImmutableDictionary<BoundDagTemp, IValueSet> whenFalseValues, 1125ImmutableDictionary<BoundDagTemp, IValueSet> whenTrueValues, 1126ImmutableDictionary<BoundDagTemp, IValueSet> whenFalseValues, 1130ImmutableDictionary<BoundDagTemp, IValueSet> values, 1149ImmutableDictionary<BoundDagTemp, IValueSet> whenTrueValues, 1150ImmutableDictionary<BoundDagTemp, IValueSet> whenFalseValues, 1169var whenTrueValues = values.SetItem(input, fromTestPassing); 1170var whenFalseValues = values.SetItem(input, fromTestFailing); 1854public ImmutableDictionary<BoundDagTemp, IValueSet> RemainingValues { get; private set; } = null!; 1883public static DagState GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 1927internal void UpdateRemainingValues(ImmutableDictionary<BoundDagTemp, IValueSet> newRemainingValues)
Binder\ImportChain.cs (1)
95ImmutableDictionary<string, AliasAndUsingDirective> aliasSymbols = Imports.UsingAliases;
Binder\Imports.cs (7)
28ImmutableDictionary<string, AliasAndUsingDirective>.Empty, 32public readonly ImmutableDictionary<string, AliasAndUsingDirective> UsingAliases; 37ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, 70var expandedAliases = ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 152ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, 185var usingAliases = this.UsingAliases.SetItems(otherImports.UsingAliases); // NB: SetItems, rather than AddRange
Binder\WithExternAliasesBinder.cs (2)
38ImmutableDictionary<string, AliasAndUsingDirective>.Empty, 56ImmutableDictionary<string, AliasAndUsingDirective>.Empty,
Binder\WithExternAndUsingAliasesBinder.cs (7)
34protected abstract ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved); 103internal static WithExternAndUsingAliasesBinder Create(ImmutableArray<AliasAndExternAliasDirective> externAliases, ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, WithUsingNamespacesAndTypesBinder next) 114private ImmutableDictionary<string, AliasAndUsingDirective>? _lazyUsingAliasesMap; 151protected override ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved) 229private readonly ImmutableDictionary<string, AliasAndUsingDirective> _usingAliases; 231internal FromSymbols(ImmutableArray<AliasAndExternAliasDirective> externAliases, ImmutableDictionary<string, AliasAndUsingDirective> usingAliases, WithUsingNamespacesAndTypesBinder next) 255protected override ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved)
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
379return Imports.Create(ImmutableDictionary<string, AliasAndUsingDirective>.Empty, _usings, ImmutableArray<AliasAndExternAliasDirective>.Empty);
BoundTree\UnboundLambda.cs (5)
526private ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>? _bindingCache; 531private ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>? _returnInferenceCache; 542_bindingCache = ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>.Empty.WithComparers(BindingCacheComparer.Instance); 543_returnInferenceCache = ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>.Empty; 1260private static BoundLambda? GuessBestBoundLambda<T>(ImmutableDictionary<T, BoundLambda> candidates)
CommandLine\CSharpCommandLineParser.cs (1)
1463var parsedFeatures = ParseFeatures(features);
Compilation\AttributeSemanticModel.cs (4)
28ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt = null) 39public static AttributeSemanticModel Create(PublicSemanticModel containingSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Symbol? attributeTarget, Binder rootBinder, ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 48public static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position) 108ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols)
Compilation\CSharpCompilation.cs (2)
944var loadedSyntaxTreeMap = syntaxAndDeclarations.GetLazyState().LoadedSyntaxTreeMap; 1012var loadedSyntaxTreeMap = syntaxAndDeclarations.GetLazyState().LoadedSyntaxTreeMap;
Compilation\InitializerSemanticModel.cs (4)
30ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt = null) : 59internal static InitializerSemanticModel Create(PublicSemanticModel containingSemanticModel, ParameterSyntax syntax, ParameterSymbol parameterSymbol, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 69internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, Symbol owner, EqualsValueClauseSyntax syntax, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position) 259ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\MemberSemanticModel.cs (9)
37private ImmutableDictionary<Symbol, Symbol> _lazyRemappedSymbols; 38private readonly ImmutableDictionary<Symbol, Symbol> _parentRemappedSymbolsOpt; 51ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 163internal ImmutableDictionary<Symbol, Symbol> GetRemappedSymbols() 206ImmutableDictionary<Symbol, Symbol> ignored = null; 1474protected void UnguardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 1482protected void GuardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 1961var remappedSymbols = _parentRemappedSymbolsOpt; 2046ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols);
Compilation\MemberSemanticModel.SpeculativeMemberSemanticModel.cs (2)
31ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 49ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\MethodBodySemanticModel.cs (6)
25internal readonly ImmutableDictionary<Symbol, Symbol>? RemappedSymbols; 32ImmutableDictionary<Symbol, Symbol>? remappedSymbols = null) 48ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt = null) 117ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, 129ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, 293ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (6)
26private ImmutableDictionary<CSharpSyntaxNode, MemberSemanticModel> _childMemberModels = ImmutableDictionary<CSharpSyntaxNode, MemberSemanticModel>.Empty; 48ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 77ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 93ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt, 106ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt,
Compilation\SyntaxAndDeclarationManager.cs (16)
314var loadDirectiveMap = state.LoadDirectiveMap; 315var loadedSyntaxTreeMap = state.LoadedSyntaxTreeMap; 386ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 387ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 388ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 434ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 435ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 478var ordinalMap = state.OrdinalMap; 479var loadDirectiveMap = state.LoadDirectiveMap; 480var loadedSyntaxTreeMap = state.LoadedSyntaxTreeMap; 607ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.Builder declMapBuilder, 608ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>>.Builder lastComputedMemberNamesMap) 668internal static bool IsLoadedSyntaxTree(SyntaxTree tree, ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 678ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 679ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap) 728private static bool TryGetLoadedSyntaxTree(ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, LoadDirective directive, out SyntaxTree loadedTree)
Compilation\SyntaxAndDeclarationManager.LazyState.cs (10)
21internal readonly ImmutableDictionary<SyntaxTree, int> OrdinalMap; // Inverse of syntaxTrees array (i.e. maps tree to index) 22internal readonly ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> LoadDirectiveMap; 23internal readonly ImmutableDictionary<string, SyntaxTree> LoadedSyntaxTreeMap; 24internal readonly ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> RootNamespaces; 43internal readonly ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> LastComputedMemberNames; 48ImmutableDictionary<SyntaxTree, int> syntaxTreeOrdinalMap, 49ImmutableDictionary<SyntaxTree, ImmutableArray<LoadDirective>> loadDirectiveMap, 50ImmutableDictionary<string, SyntaxTree> loadedSyntaxTreeMap, 51ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> rootNamespaces, 52ImmutableDictionary<SyntaxTree, OneOrMany<WeakReference<StrongBox<ImmutableSegmentedHashSet<string>>>>> lastComputedMemberNames,
Compilation\SyntaxTreeSemanticModel.cs (3)
35private ImmutableDictionary<CSharpSyntaxNode, MemberSemanticModel> _memberModels = ImmutableDictionary<CSharpSyntaxNode, MemberSemanticModel>.Empty; 975internal ImmutableDictionary<CSharpSyntaxNode, MemberSemanticModel> TestOnlyMemberModels => _memberModels;
Compiler\MethodCompiler.cs (1)
1909ImmutableDictionary<Symbol, Symbol>? remappedSymbols = null;
CSharpCompilationOptions.cs (3)
445protected override CompilationOptions CommonWithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>? specificDiagnosticOptions) => 464public new CSharpCompilationOptions WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>? values) 468values = ImmutableDictionary<string, ReportDiagnostic>.Empty;
CSharpParseOptions.cs (5)
24private ImmutableDictionary<string, string> _features; 59ImmutableDictionary<string, string>.Empty) 74_features = features?.ToImmutableDictionary() ?? ImmutableDictionary<string, string>.Empty; 165ImmutableDictionary<string, string> dictionary = 167?? ImmutableDictionary<string, string>.Empty;
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
105ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap;
Errors\ErrorFacts.cs (3)
21private static readonly Lazy<ImmutableDictionary<ErrorCode, string>> s_categoriesMap = new Lazy<ImmutableDictionary<ErrorCode, string>>(CreateCategoriesMap); 96private static ImmutableDictionary<ErrorCode, string> CreateCategoriesMap()
FlowAnalysis\NullableWalker.cs (11)
222private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)>.Builder? _analyzedNullabilityMapOpt; 467ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt, 1583ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1585ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> analyzedNullabilitiesMap; 1590private static (SnapshotManager?, ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>) AnalyzeWithSemanticInfo( 1627var analyzedNullabilitiesMap = analyzedNullabilities.ToImmutable(); 1656ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1688var analyzedNullabilitiesMap = analyzedNullabilities.ToImmutable(); 1698private static BoundNode Rewrite(ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> updatedNullabilities, SnapshotManager? snapshotManager, BoundNode node, ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1824ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt,
FlowAnalysis\NullableWalker.DebugVerifier.cs (3)
21private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _analyzedNullabilityMap; 26private DebugVerifier(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> analyzedNullabilityMap, SnapshotManager? snapshotManager) 37public static void Verify(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> analyzedNullabilityMap, SnapshotManager? snapshotManagerOpt, BoundNode node)
FlowAnalysis\NullableWalker.SnapshotManager.cs (4)
31private readonly ImmutableDictionary<(BoundNode?, Symbol), Symbol> _updatedSymbolsMap; 35private SnapshotManager(ImmutableArray<SharedWalkerState> walkerSharedStates, ImmutableArray<(int position, Snapshot snapshot)> incrementalSnapshots, ImmutableDictionary<(BoundNode?, Symbol), Symbol> updatedSymbolsMap) 148private readonly ImmutableDictionary<(BoundNode?, Symbol), Symbol>.Builder _updatedSymbolMap = ImmutableDictionary.CreateBuilder<(BoundNode?, Symbol), Symbol>(ExpressionAndSymbolEqualityComparer.Instance, Symbols.SymbolEqualityComparer.ConsiderEverything); 177var updatedSymbols = _updatedSymbolMap.ToImmutable();
FlowAnalysis\NullableWalker.Variables.cs (2)
48internal readonly ImmutableDictionary<Symbol, TypeWithAnnotations> VariableTypes; 50internal VariablesSnapshot(int id, VariablesSnapshot? container, Symbol? symbol, ImmutableArray<KeyValuePair<VariableIdentifier, int>> variableSlot, ImmutableDictionary<Symbol, TypeWithAnnotations> variableTypes)
Generated\BoundNodes.xml.Generated.cs (4)
12389private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _updatedNullabilities; 12391private readonly ImmutableDictionary<Symbol, Symbol>.Builder _remappedSymbols; 12393public NullabilityRewriter(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> updatedNullabilities, NullableWalker.SnapshotManager? snapshotManager, ImmutableDictionary<Symbol, Symbol>.Builder remappedSymbols)
Lowering\ExtensionMethodBodyRewriter.cs (6)
25private ImmutableDictionary<Symbol, Symbol> _symbolMap; 41_symbolMap = ImmutableDictionary<Symbol, Symbol>.Empty.WithComparers(ReferenceEqualityComparer.Instance, ReferenceEqualityComparer.Instance); 54private (RewrittenMethodSymbol, ImmutableDictionary<Symbol, Symbol>) EnterMethod(MethodSymbol symbol, RewrittenMethodSymbol rewritten, ReadOnlySpan<ParameterSymbol> rewrittenParameters) 56ImmutableDictionary<Symbol, Symbol> saveSymbolMap = _symbolMap; 76private (RewrittenMethodSymbol, ImmutableDictionary<Symbol, Symbol>) EnterMethod(MethodSymbol symbol, RewrittenLambdaOrLocalFunctionSymbol rewritten) 122ImmutableDictionary<Symbol, Symbol> saveSymbolMap = _symbolMap;
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (1)
68protected (ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) LowerDecisionDag(BoundDecisionDag decisionDag)
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
115(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) =
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
63(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) =
Symbols\Compilation_UsedAssemblies.cs (1)
32ImmutableDictionary<MetadataReference, ImmutableArray<MetadataReference>> mergedAssemblyReferencesMap = GetBoundReferenceManager().MergedAssemblyReferencesMap;
Symbols\ReferenceManager.cs (2)
246public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata metadata, MetadataImportOptions importOptions, out ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap) 379ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>.Empty;
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
26public ImmutableDictionary<MethodSymbol, MethodSymbol>? LazyImplementationMap;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (23)
89ref ImmutableDictionary<SingleNamespaceDeclaration, AliasesAndUsings> dictionary, 174public ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 181var result = GetGlobalUsingAliasesMap(basesBeingResolved); 195return ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 243private ImmutableDictionary<string, AliasAndUsingDirective> GetGlobalUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved) 263ImmutableDictionary<string, AliasAndUsingDirective>? mergedAliases = null; 281var aliases = GetAliasesAndUsings(singleDeclaration).GetGlobalUsingAliasesMap(this, singleDeclaration.SyntaxReference, basesBeingResolved); 356var globalAliasesMap = ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 380UsingAliasesMap = mergedAliases ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty, 520internal ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 522return GetUsingsAndDiagnostics(declaringSymbol, declarationSyntax, basesBeingResolved).UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 525internal ImmutableDictionary<string, AliasAndUsingDirective> GetGlobalUsingAliasesMap(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 527return (_lazyGlobalUsings ?? GetGlobalUsingsAndDiagnostics(declaringSymbol, (CSharpSyntaxNode)declarationSyntax.GetSyntax(), basesBeingResolved)).UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 599Debug.Assert((calculated.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty).SetEquals(result.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty)); 624var globalUsingAliasesMap = ImmutableDictionary<string, AliasAndUsingDirective>.Empty; 641ImmutableDictionary<string, AliasAndUsingDirective>.Builder? usingAliasesMap = null; 1104public ImmutableDictionary<string, AliasAndUsingDirective>? UsingAliasesMap { get; init; } 1122UsingAliasesMap = ImmutableDictionary<string, AliasAndUsingDirective>.Empty, 1128public ImmutableDictionary<string, AliasAndUsingDirective>? UsingAliasesMap { get; init; } 1139Imports.Create(UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty,
Symbols\Source\SourceNamespaceSymbol.cs (4)
22private static readonly ImmutableDictionary<SingleNamespaceDeclaration, AliasesAndUsings> s_emptyMap = 23ImmutableDictionary<SingleNamespaceDeclaration, AliasesAndUsings>.Empty.WithComparers(ReferenceEqualityComparer.Instance); 39private ImmutableDictionary<SingleNamespaceDeclaration, AliasesAndUsings> _aliasesAndUsings_doNotAccessDirectly = s_emptyMap; 44private ImmutableDictionary<SingleNamespaceDeclaration, AliasesAndUsings> _aliasesAndUsingsForAsserts_doNotAccessDirectly = s_emptyMap;
Symbols\TypeSymbol.cs (2)
85internal ImmutableDictionary<MethodSymbol, MethodSymbol>? synthesizedMethodImplMap; 2347ImmutableDictionary<MethodSymbol, MethodSymbol> makeSynthesizedMethodImplMap()
Syntax\CSharpPragmaWarningStateMap.cs (1)
86var accumulatedSpecificWarningState = ImmutableDictionary.Create<string, PragmaWarningState>();
Syntax\CSharpSyntaxTree.cs (6)
335ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 455ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 493ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 915ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 927ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 939ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions)
Syntax\CSharpSyntaxTree.Dummy.cs (1)
60public override ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (4)
22private readonly ImmutableDictionary<string, ReportDiagnostic> _diagnosticOptions; 29ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions) 102public override ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions => _diagnosticOptions; 155public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (4)
28private readonly ImmutableDictionary<string, ReportDiagnostic> _diagnosticOptions; 39ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 116public override ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions => _diagnosticOptions; 162public override SyntaxTree WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic> options)
Syntax\SyntaxFactory.cs (4)
2798ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 2811ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 2825ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions, 2839ImmutableDictionary<string, ReportDiagnostic>? diagnosticOptions,
Microsoft.CodeAnalysis.CSharp.CodeStyle (35)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
62ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
65ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToProgramMainDiagnosticAnalyzer.cs (1)
62ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
82ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
74properties: ImmutableDictionary<string, string?>.Empty
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
176var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
21private static readonly ImmutableDictionary<string, string?> s_subsequentSectionProperties = ImmutableDictionary<string, string?>.Empty.Add(IsSubsequentSection, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (2)
20public static readonly ImmutableDictionary<string, string?> ChangesSemantics = 21ImmutableDictionary<string, string?>.Empty.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
207var properties = changesSemantics ? ChangesSemantics : null;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
53var properties = analysisResult.ChangesSemantics ? ChangesSemantics : null;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
49var properties = GetDiagnosticProperties(unwrapArgument, useSpread, changesSemantics);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
91var properties = GetDiagnosticProperties(unwrapArgument, useSpread, changesSemantics);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1216public static ImmutableDictionary<string, string?> GetDiagnosticProperties(bool unwrapArgument, bool useSpread, bool changesSemantics) 1218var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (4)
105var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(UseExpressionBody), ""); 119var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
83ImmutableDictionary<string, string?>.Empty); 97ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
211ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
329ImmutableDictionary<string, string?>.Empty,
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (4)
18private static readonly ImmutableDictionary<string, string?> s_properties = 19ImmutableDictionary<string, string?>.Empty.Add(UseIsNullConstants.Kind, UseIsNullConstants.CastAndEqualityKey); 20private static readonly ImmutableDictionary<string, string?> s_NegatedProperties = 61var properties = binaryExpression.Kind() == SyntaxKind.EqualsExpression
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
106ImmutableDictionary<string, string?>.Empty.Add(NameKey, stringValue)));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (2)
31private static readonly ImmutableDictionary<string, string?> s_safeProperties = ImmutableDictionary<string, string?>.Empty.Add(SafeKey, "");
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (2)
143var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(ArrayCreationOperationLocation), operationLocation.ToString());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (29)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
67var properties = diagnostic.Properties;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (9)
195var assignmentValues = GetAssignmentValuesForConstructor(operation, 237var assignmentValues = GetAssignmentValuesForConstructor(operation, 293var assignmentValues = GetAssignmentValuesForConstructor(operation, 378var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 403ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 419private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 424var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 430return ImmutableDictionary<ISymbol, T>.Empty; 461return ImmutableDictionary<ISymbol, T>.Empty;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
38ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
39ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
37ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
47ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
39ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
34ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
37ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (7)
66var properties = diagnostic.Properties; 98ImmutableDictionary<string, string?> properties, 114ImmutableDictionary<string, string?> properties, 129var removedMembers = await RemoveMembersAsync().ConfigureAwait(false); 512async ValueTask<ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)>> RemoveMembersAsync() 514var removedMembers = ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)>.Empty;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (4)
68ImmutableDictionary<string, string?> properties, 69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 166ImmutableDictionary<string, string?> properties, 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
InlineRename\CSharpEditorInlineRenameService.cs (1)
37public override async Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
Completion\CompletionServiceTests.cs (1)
114var options = new TestOptionSet(ImmutableDictionary<OptionKey, object>.Empty.Add(new OptionKey(ThirdPartyOption.Instance, LanguageNames.CSharp), 1));
Rename\CSharpInlineRenameServiceTests.cs (8)
27private sealed class ContextDictionaryComparer : IEqualityComparer<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>?> 31public bool Equals(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>? x, ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>? y) 54public int GetHashCode(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>? obj) 55=> EqualityComparer<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>?>.Default.GetHashCode(obj); 73var expectedContext = JsonSerializer.Deserialize<ImmutableDictionary<string, ImmutableArray<(string, string)>>>(expectedContextJson, serializationOptions); 74AssertEx.AreEqual<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>?>(expectedContext, context, comparer: ContextDictionaryComparer.Instance);
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (1)
70expectedCode, out var massaged, out int? caretPosition, out ImmutableDictionary<string, ImmutableArray<TextSpan>> spans);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
37var pdbOptions = DeterministicBuildCompilationTestHelpers.ParseCompilationOptions(compilationOptionsBlobReader);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (24)
Attributes\AttributeTests_WellKnownAttributes.cs (6)
8807verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Warn)), 8813verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Error)), 8819verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Hidden)), 8825verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Suppress))); 8828verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS0618", ReportDiagnostic.Error)), 8834verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS0618", ReportDiagnostic.Suppress)),
Diagnostics\DiagnosticAnalyzerTests.cs (10)
1508var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "true")); 1516analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "TRUE")); 1522analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "false")); 1528analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "auto")); 3710var diagnosticsMap = syntax ? analysisResult.SyntaxDiagnostics : analysisResult.SemanticDiagnostics; 3711var diagnostics = diagnosticsMap.TryGetValue(tree1, out var value) ? value : ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 4023if (analysisResult.AdditionalFileDiagnostics.TryGetValue(additionalFile, out var diagnosticsMap) && 4195.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Warn))
Diagnostics\DiagnosticSuppressorTests.cs (3)
313var specificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions.Add(suppressionId, ReportDiagnostic.Suppress); 328var originalSpecificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions; 359var specificDiagnosticOptions = originalSpecificDiagnosticOptions.Add(
Diagnostics\GetDiagnosticsTests.cs (5)
683var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("dotnet_analyzer_diagnostic.severity", "none")); 685ImmutableDictionary<object, AnalyzerConfigOptions>.Empty.Add(compilation.SyntaxTrees.Single(), analyzerConfigOptions), 729var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add(options.Value.key, options.Value.value)); 731ImmutableDictionary<object, AnalyzerConfigOptions>.Empty.Add(compilation.SyntaxTrees.Single(), analyzerConfigOptions), 1208var diagnosticsByAnalyzerMap = result.SemanticDiagnostics[syntaxTree];
Microsoft.CodeAnalysis.CSharp.Features (76)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
110var parameterToSynthesizedFields = CreateSynthesizedFields(); 182ImmutableDictionary<IParameterSymbol, IFieldSymbol> CreateSynthesizedFields()
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (5)
121private static ImmutableDictionary<ExtensionMethodInfo, ImmutableArray<ExtensionMethodInfo>> GetAllExtensionMethods( 162var allExtensionMethods = GetAllExtensionMethods( 178var allExtensionMethods = GetAllExtensionMethods( 195ImmutableDictionary<ExtensionMethodInfo, ImmutableArray<ExtensionMethodInfo>> allExtensionMethods, 220ImmutableDictionary<ExtensionMethodInfo, ImmutableArray<ExtensionMethodInfo>> allExtensionMethods,
ConvertToExtension\ConvertToExtensionFixAllProvider.cs (1)
44var extensionMethods = GetAllExtensionMethods(semanticModel, declaration, cancellationToken);
ExtractInterface\CSharpExtractInterfaceService.cs (1)
69IEnumerable<ISymbol> includedMembers, ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationMap,
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
62ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
65ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToProgramMainDiagnosticAnalyzer.cs (1)
62ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
82ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
74properties: ImmutableDictionary<string, string?>.Empty
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
176var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
21private static readonly ImmutableDictionary<string, string?> s_subsequentSectionProperties = ImmutableDictionary<string, string?>.Empty.Add(IsSubsequentSection, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (2)
20public static readonly ImmutableDictionary<string, string?> ChangesSemantics = 21ImmutableDictionary<string, string?>.Empty.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
207var properties = changesSemantics ? ChangesSemantics : null;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
53var properties = analysisResult.ChangesSemantics ? ChangesSemantics : null;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
49var properties = GetDiagnosticProperties(unwrapArgument, useSpread, changesSemantics);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
91var properties = GetDiagnosticProperties(unwrapArgument, useSpread, changesSemantics);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1216public static ImmutableDictionary<string, string?> GetDiagnosticProperties(bool unwrapArgument, bool useSpread, bool changesSemantics) 1218var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (4)
105var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(UseExpressionBody), ""); 119var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
83ImmutableDictionary<string, string?>.Empty); 97ImmutableDictionary<string, string?>.Empty);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
211ImmutableDictionary<string, string?>.Empty));
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
329ImmutableDictionary<string, string?>.Empty,
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (4)
18private static readonly ImmutableDictionary<string, string?> s_properties = 19ImmutableDictionary<string, string?>.Empty.Add(UseIsNullConstants.Kind, UseIsNullConstants.CastAndEqualityKey); 20private static readonly ImmutableDictionary<string, string?> s_NegatedProperties = 61var properties = binaryExpression.Kind() == SyntaxKind.EqualsExpression
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
106ImmutableDictionary<string, string?>.Empty.Add(NameKey, stringValue)));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (2)
31private static readonly ImmutableDictionary<string, string?> s_safeProperties = ImmutableDictionary<string, string?>.Empty.Add(SafeKey, "");
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (2)
143var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(ArrayCreationOperationLocation), operationLocation.ToString());
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
67var properties = diagnostic.Properties;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (9)
195var assignmentValues = GetAssignmentValuesForConstructor(operation, 237var assignmentValues = GetAssignmentValuesForConstructor(operation, 293var assignmentValues = GetAssignmentValuesForConstructor(operation, 378var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 403ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 419private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 424var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 430return ImmutableDictionary<ISymbol, T>.Empty; 461return ImmutableDictionary<ISymbol, T>.Empty;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
38ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
39ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
37ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
47ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
39ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
34ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
37ImmutableDictionary<string, string?> properties,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (7)
66var properties = diagnostic.Properties; 98ImmutableDictionary<string, string?> properties, 114ImmutableDictionary<string, string?> properties, 129var removedMembers = await RemoveMembersAsync().ConfigureAwait(false); 512async ValueTask<ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)>> RemoveMembersAsync() 514var removedMembers = ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)>.Empty;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (4)
68ImmutableDictionary<string, string?> properties, 69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 166ImmutableDictionary<string, string?> properties, 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
Structure\CSharpBlockStructureProvider.cs (2)
16private static ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> CreateDefaultNodeProviderMap() 61private static ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> CreateDefaultTriviaProviderMap()
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
102ImmutableDictionary<string, string?>.Empty));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (11)
Copilot\CSharpImplementNotImplementedExceptionFixProviderTests.cs (10)
179copilotService.SetupFixAll = (Document document, ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> memberReferences, CancellationToken cancellationToken) => 540private static ImmutableDictionary<SyntaxNode, ImplementationDetails> BuildResult(ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> memberReferences, Dictionary<string, string> implementationMap) 644public Func<Document, ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>>, CancellationToken, ImmutableDictionary<SyntaxNode, ImplementationDetails>>? SetupFixAll { get; internal set; } 672public Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync( 674ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties, 687return Task.FromResult(ImmutableDictionary<SyntaxNode, ImplementationDetails>.Empty); 690private static ImmutableDictionary<SyntaxNode, ImplementationDetails> CreateSingleNodeResult( 691ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties,
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1214ImmutableDictionary<string, ReportDiagnostic>.Empty
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\ImportsTests.cs (2)
124ImmutableDictionary<string, AliasAndUsingDirective>.Empty, 129ImmutableDictionary<string, AliasAndUsingDirective>.Empty,
Semantics\InitOnlyMemberTests.cs (2)
3469ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS1685", ReportDiagnostic.Suppress))); 3568ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS1685", ReportDiagnostic.Suppress)));
SourceGeneration\GeneratorDriverTests.cs (4)
855var options = new CompilerAnalyzerConfigOptionsProvider(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("a", "abc").Add("b", "def"))); 2758var builder = ImmutableDictionary<string, string>.Empty.ToBuilder(); 2760var optionsProvider = new CompilerAnalyzerConfigOptionsProvider(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, new DictionaryAnalyzerConfigOptions(builder.ToImmutable()));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DeclarationTests.cs (1)
994public override ImmutableDictionary<string, ReportDiagnostic> DiagnosticOptions => throw new NotImplementedException();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
Syntax\SyntaxTreeTests.cs (8)
130var options = CreateImmutableDictionary(("CS0078", ReportDiagnostic.Suppress)); 140var options = CreateImmutableDictionary(("CS0078", ReportDiagnostic.Suppress)); 166Assert.NotSame(ImmutableDictionary<string, ReportDiagnostic>.Empty, tree.DiagnosticOptions); 176diagnosticOptions: ImmutableDictionary<string, ReportDiagnostic>.Empty, 181Assert.Same(ImmutableDictionary<string, ReportDiagnostic>.Empty, tree.DiagnosticOptions); 187var options = CreateImmutableDictionary(("CS0078", ReportDiagnostic.Suppress)); 220var newTree = tree.WithDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty); 231var map = ImmutableDictionary.CreateRange(
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CSharpTestBase.cs (1)
2888internal static ImmutableDictionary<string, ReportDiagnostic> ReportStructInitializationWarnings { get; } = ImmutableDictionary.CreateRange(
TestOptions.cs (2)
174return options.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(key, value)); 179return options.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(key1, value).Add(key2, value));
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
LanguageServices\FixAllSpanMappingService\CSharpFixAllSpanMappingService.cs (4)
28protected override async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 34return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 47return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 52return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty
Rename\CSharpRenameRewriterLanguageService.cs (2)
54private readonly ImmutableDictionary<TextSpan, RenameLocation> _renameLocations; 91private readonly ImmutableDictionary<TextSpan, ImmutableSortedSet<TextSpan>?> _stringAndCommentTextSpans;
Microsoft.CodeAnalysis.Debugging.Package (3)
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.EditorFeatures (40)
CodeLens\ICodeLensContext.cs (1)
20Task<ImmutableDictionary<Guid, string>> GetProjectVersionsAsync(ImmutableArray<Guid> projectGuids, CancellationToken cancellationToken);
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
165public ImmutableDictionary<string, (DocumentState state, int solutionVersion)> GetDocumentsWithChangedLoaderByPath()
EditorConfigSettings\Aggregator\SettingsAggregator.cs (1)
117var projectCountByLanguage = solution.ProjectCountByLanguage;
ExternalAccess\IntelliCode\Api\IIntentSourceProvider.cs (2)
62internal readonly struct IntentSource(string title, string actionName, ImmutableDictionary<DocumentId, ImmutableArray<TextChange>> documentChanges) 72public readonly ImmutableDictionary<DocumentId, ImmutableArray<TextChange>> DocumentChanges = documentChanges;
ExternalAccess\IntelliCode\IntentProcessor.cs (2)
27private readonly ImmutableDictionary<(string LanguageName, string IntentName), Lazy<IIntentProvider, IIntentProviderMetadata>> _lazyIntentProviders = CreateProviderMap(lazyIntentProviders); 29private static ImmutableDictionary<(string LanguageName, string IntentName), Lazy<IIntentProvider, IIntentProviderMetadata>> CreateProviderMap(
ExternalAccess\VSTypeScript\VSTypeScriptEditorInlineRenameService.cs (2)
39public Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(IInlineRenameInfo inlineRenameInfo, IInlineRenameLocationSet inlineRenameLocationSet, CancellationToken cancellationToken) 41return Task.FromResult(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>.Empty);
InlineRename\AbstractEditorInlineRenameService.cs (2)
35public virtual Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(IInlineRenameInfo inlineRenameInfo, IInlineRenameLocationSet inlineRenameLocationSet, CancellationToken cancellationToken) 37return Task.FromResult(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>.Empty);
InlineRename\AbstractEditorInlineRenameService.InlineRenameReplacementInfo.cs (1)
40var modifiedSpans = _conflicts.GetModifiedSpanMap(documentId);
InlineRename\IEditorInlineRenameService.cs (1)
270Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(
InlineRename\UI\SmartRename\SmartRenameViewModel.cs (5)
39/// Cancellation token source for <see cref="ISmartRenameSessionWrapper.GetSuggestionsAsync(ImmutableDictionary{string, ImmutableArray{ValueTuple{string, string}}}, CancellationToken)"/>. 71/// and call to <see cref="ISmartRenameSessionWrapper.GetSuggestionsAsync(ImmutableDictionary{string, ImmutableArray{ValueTuple{string, string}}}, CancellationToken)"/>. 201/// 3. Call to <see cref="ISmartRenameSessionWrapper.GetSuggestionsAsync(ImmutableDictionary{string, ImmutableArray{ValueTuple{string, string}}}, CancellationToken)"/>. 227var smartRenameContext = ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>.Empty;
IntelliSense\AsyncCompletion\FilterSet.cs (1)
34private static readonly ImmutableDictionary<string, FilterWithMask> s_filterMap;
Lightup\ISmartRenameSessionWrapper.cs (1)
129public Task<IReadOnlyList<string>> GetSuggestionsAsync(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>> context, CancellationToken cancellationToken)
Suggestions\FixAll\FixMultipleOccurrencesService.cs (2)
28ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 46ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (2)
87private ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> _cachedTagTrees_mayChangeFromAnyThread = ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>>.Empty;
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (14)
57var oldTagTrees = Interlocked.Exchange( 58ref _cachedTagTrees_mayChangeFromAnyThread, ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>>.Empty); 241private async Task<(ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> oldTagTrees, ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> newTagTrees, TResult)> 243Func<ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>>, TArgs, CancellationToken, ValueTask<(ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> newTagTrees, TResult result)>> callback, 249var oldTagTrees = _cachedTagTrees_mayChangeFromAnyThread; 282private async Task<ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>>?> RecomputeTagsAsync( 469private ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> ComputeNewTagTrees( 470ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> oldTagTrees, 514ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> oldTagTrees, 599ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> oldTagTrees, 600ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> newTagTrees) 735var tagTrees = _cachedTagTrees_mayChangeFromAnyThread;
Tagging\TaggerContext.cs (2)
20private readonly ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> _existingTags; 74ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> existingTags)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Classification\FormattedClassification.cs (2)
15private static readonly ImmutableDictionary<string, string> s_classificationPrefixToTestHelperMap = ImmutableDictionary<string, string>.Empty
CompleteStatement\AbstractCompleteStatementTests.cs (1)
40TestFileMarkupParser.GetPositionsAndSpans(initialMarkup, out var output, out var positions, out var spans);
Squiggles\TestDiagnosticTagProducer.cs (1)
42properties: ImmutableDictionary<string, string?>.Empty,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (13)
CodeFixes\ExtensionOrderingTests.cs (1)
133var codeFixPriorityMap = codeFixService.GetTestAccessor().GetFixerPriorityPerLanguageMap(services: null!)[language].Value;
Collections\Immutable\Maps\MapTests.cs (4)
21var map = ImmutableDictionary.Create<string, int>().Add("1", 1); 38var map = ImmutableDictionary.Create<string, int>() 53var map = ImmutableDictionary.Create<string, int>() 85var map = ImmutableDictionary.Create<string, int>(new PathologicalComparer<string>())
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
283var newSpecificOptions = project.CompilationOptions.SpecificDiagnosticOptions.Add(NamedTypeAnalyzer.DiagnosticId, ReportDiagnostic.Warn);
Diagnostics\DiagnosticDataTests.cs (5)
124properties: ImmutableDictionary<string, string>.Empty, 157properties: ImmutableDictionary<string, string>.Empty, 192properties: ImmutableDictionary<string, string>.Empty, 240properties: ImmutableDictionary<string, string>.Empty, 288properties: ImmutableDictionary<string, string>.Empty,
EditAndContinue\EditAndContinueLanguageServiceTests.cs (2)
214ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty.Add(project.Id, []) 278ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
CodeFixes\CodeFixServiceTests.vb (3)
381Public Function ImplementNotImplementedExceptionsAsync(document As Document, methodOrProperties As ImmutableDictionary(Of SyntaxNode, ImmutableArray(Of ReferencedSymbol)), cancellationToken As CancellationToken) As Task(Of ImmutableDictionary(Of SyntaxNode, ImplementationDetails)) Implements ICopilotCodeAnalysisService.ImplementNotImplementedExceptionsAsync 382Return Task.FromResult(ImmutableDictionary(Of SyntaxNode, ImplementationDetails).Empty)
Diagnostics\DiagnosticProviderTests.vb (1)
360properties:=ImmutableDictionary(Of String, String).Empty,
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (28)
MetadataContext.cs (2)
14internal readonly ImmutableDictionary<MetadataContextId, TAssemblyContext> AssemblyContexts; 16internal MetadataContext(ImmutableArray<MetadataBlock> metadataBlocks, ImmutableDictionary<MetadataContextId, TAssemblyContext> assemblyContexts)
PDB\MethodDebugInfo.cs (4)
39public readonly ImmutableDictionary<int, ImmutableArray<bool>>? DynamicLocalMap; // C# only. 40public readonly ImmutableDictionary<int, ImmutableArray<string?>>? TupleLocalMap; 52ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap, 53ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalMap,
PDB\MethodDebugInfo.Native.cs (16)
135ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap = null; 136ImmutableDictionary<string, ImmutableArray<bool>>? dynamicLocalConstantMap = null; 137ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalMap = null; 138ImmutableDictionary<LocalNameAndScope, ImmutableArray<string?>>? tupleLocalConstantMap = null; 385out ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap, 386out ImmutableDictionary<string, ImmutableArray<bool>>? dynamicLocalConstantMap) 400ImmutableDictionary<int, ImmutableArray<bool>>.Builder? localBuilder = null; 401ImmutableDictionary<string, ImmutableArray<bool>>.Builder? constantBuilder = null; 473out ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalMap, 474out ImmutableDictionary<LocalNameAndScope, ImmutableArray<string?>>? tupleLocalConstantMap) 485ImmutableDictionary<int, ImmutableArray<string?>>.Builder? localBuilder = null; 486ImmutableDictionary<LocalNameAndScope, ImmutableArray<string?>>.Builder? constantBuilder = null; 632ImmutableDictionary<string, ImmutableArray<bool>>? dynamicLocalConstantMap, 633ImmutableDictionary<LocalNameAndScope, ImmutableArray<string?>>? tupleLocalConstantMap) 694ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap, 695ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalConstantMap)
PDB\MethodDebugInfo.Portable.cs (6)
26ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap; 27ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalMap; 131out ImmutableDictionary<int, ImmutableArray<bool>>? dynamicLocalMap, 132out ImmutableDictionary<int, ImmutableArray<string?>>? tupleLocalMap, 139ImmutableDictionary<int, ImmutableArray<bool>>.Builder? lazyDynamicLocalsBuilder = null; 140ImmutableDictionary<int, ImmutableArray<string?>>.Builder? lazyTupleLocalsBuilder = null;
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (4)
SpecialTypeExtensions.cs (2)
20private static readonly ImmutableDictionary<SpecialType, QualifiedTypeSignature> s_typeSignatures = GetTypeSignatures(); 22private static ImmutableDictionary<SpecialType, QualifiedTypeSignature> GetTypeSignatures()
VisualBasic\MemberSignatureParser.cs (1)
18internal static readonly ImmutableDictionary<string, SyntaxKind> KeywordKinds = GetKeywordKinds(StringComparer);
VisualBasic\SyntaxKind.cs (1)
40private static ImmutableDictionary<string, SyntaxKind> GetKeywordKinds(StringComparer comparer)
Microsoft.CodeAnalysis.Extensions.Package (17)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.ExternalAccess.Copilot (9)
GenerateImplementation\IExternalCSharpCopilotGenerateImplementationService.cs (2)
15Task<ImmutableDictionary<SyntaxNode, ImplementationDetailsWrapper>> ImplementNotImplementedExceptionsAsync( 17ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties,
Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (4)
49protected abstract Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsCoreAsync(Document document, ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties, CancellationToken cancellationToken); 217public async Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync( 219ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties,
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (3)
159protected override async Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsCoreAsync( 161ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties, 165var nodeToWrappers = await GenerateImplementationService.ImplementNotImplementedExceptionsAsync(document, methodOrProperties, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
GlassTestsHotReloadService.cs (1)
87var results = (await _encService.EmitSolutionUpdateAsync(GetSessionId(), solution, runningProjects: ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty, s_noActiveStatementSpanProvider, cancellationToken).ConfigureAwait(false)).Dehydrate();
Microsoft.CodeAnalysis.ExternalAccess.FSharp (6)
Completion\FSharpCommonCompletionItem.cs (1)
24ImmutableDictionary<string, string> properties = null,
FSharpDocumentSpan.cs (2)
25public ImmutableDictionary<string, object> Properties { get; } = ImmutableDictionary<string, object>.Empty;
Internal\Editor\FSharpEditorInlineRenameService.cs (2)
205public Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(IInlineRenameInfo inlineRenameInfo, IInlineRenameLocationSet inlineRenameLocationSet, CancellationToken cancellationToken) 207return Task.FromResult(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>.Empty);
VS\IFSharpWorkspaceProjectContextFactory.cs (1)
102private ImmutableDictionary<string, IFSharpWorkspaceProjectContext> _projectReferences;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (3)
Formatting\OmniSharpSyntaxFormattingOptionsWrapper.cs (1)
28StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (2)
24var oldFallbackOptions = oldSolution.FallbackAnalyzerOptions; 51var newFallbackOptions = oldFallbackOptions.SetItem(
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Remote\RazorRemoteServiceCallbackDispatcherRegistry.cs (1)
16private readonly ImmutableDictionary<Type, RazorRemoteServiceCallbackDispatcher> _lazyDispatchers;
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (4)
RazorPredefinedProviderNameTests.cs (4)
23var roslynProviderNames = GetPredefinedNamesFromFields(roslynProviderNamesType); 24var razorProviderNames = GetPredefinedNamesFromProperties(razorProviderNamesType); 49private static ImmutableDictionary<string, string> GetPredefinedNamesFromFields(Type namesType) 56private static ImmutableDictionary<string, string> GetPredefinedNamesFromProperties(Type namesType)
Microsoft.CodeAnalysis.Features (372)
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
68var properties = diagnostic.Properties;
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (2)
20ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 35ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\Service\CodeFixService.cs (39)
43private readonly Lazy<ImmutableDictionary<string, ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>>>> _fixersPerLanguageMap; 45private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>> _projectFixersMap = new(); 48private readonly Lazy<ImmutableDictionary<LanguageKind, Lazy<ImmutableArray<IConfigurationFixProvider>>>> _configurationProvidersMap; 51private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>? _lazyWorkspaceFixersMap; 52private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>? _lazyFixerPriorityMap; 54private ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>> _fixerToFixableIdsMap = ImmutableDictionary<CodeFixProvider, ImmutableArray<DiagnosticId>>.Empty; 55private ImmutableDictionary<object, FixAllProviderInfo?> _fixAllProviderMap = ImmutableDictionary<object, FixAllProviderInfo?>.Empty; 56private ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?> _fixerToMetadataMap = ImmutableDictionary<CodeFixProvider, CodeChangeProviderMetadata?>.Empty; 86var hasWorkspaceFixers = TryGetWorkspaceFixersMap(document, out var workspaceFixersMap); 87var projectFixersMap = GetProjectFixers(document); 367private bool TryGetWorkspaceFixersMap(TextDocument document, [NotNullWhen(true)] out ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>? fixerMap) 371var workspaceFixersMap = GetFixerPerLanguageMap(document.Project.Solution.Services); 377fixerMap = ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty; 393private bool TryGetWorkspaceFixersPriorityMap(TextDocument document, [NotNullWhen(true)] out Lazy<ImmutableDictionary<CodeFixProvider, int>>? fixersPriorityMap) 397var fixersPriorityByLanguageMap = GetFixerPriorityPerLanguageMap(document.Project.Solution.Services); 455var hasAnySharedFixer = TryGetWorkspaceFixersMap(document, out var fixerMap); 457var projectFixersMap = GetProjectFixers(document); 879private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap( 882var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>(); 886var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() => 917private static ImmutableDictionary<LanguageKind, Lazy<ImmutableArray<IConfigurationFixProvider>>> GetConfigurationProvidersPerLanguageMap( 942private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services) 944var languageMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>(); 947var lazyMap = new Lazy<ImmutableDictionary<CodeFixProvider, int>>(() => 969private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> GetProjectFixers(TextDocument document) 973? ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>.Empty 977private ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>> ComputeProjectFixers(TextDocument document) 1008private readonly ImmutableDictionary<CodeFixProvider, int> _priorityMap; 1012ImmutableDictionary<CodeFixProvider, int> priorityMap) 1049public ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (3)
45ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 75ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 135ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (6)
41internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Document triggerDocument, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument) 48internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Project triggerProject, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject) 70ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument, 99ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 190private static void AddDiagnosticForSymbolIfNeeded(ISymbol targetSymbol, Diagnostic diagnostic, ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 206private static IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> CreateDiagnosticsBySymbol(ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder)
CodeRefactorings\CodeRefactoringService.cs (7)
33private readonly Lazy<ImmutableDictionary<ProviderKey, Lazy<ImmutableArray<CodeRefactoringProvider>>>> _lazyLanguageDocumentToProvidersMap = 34new Lazy<ImmutableDictionary<ProviderKey, Lazy<ImmutableArray<CodeRefactoringProvider>>>>(() => 41private readonly Lazy<ImmutableDictionary<CodeRefactoringProvider, CodeChangeProviderMetadata>> _lazyRefactoringToMetadataMap = new(() => providers.Where(provider => provider.IsValueCreated).ToImmutableDictionary(provider => provider.Value, provider => provider.Metadata)); 43private ImmutableDictionary<CodeRefactoringProvider, FixAllProviderInfo?> _fixAllProviderMap = ImmutableDictionary<CodeRefactoringProvider, FixAllProviderInfo?>.Empty; 74private ImmutableDictionary<ProviderKey, Lazy<ImmutableArray<CodeRefactoringProvider>>> LanguageDocumentToProvidersMap 77private ImmutableDictionary<CodeRefactoringProvider, CodeChangeProviderMetadata> RefactoringToMetadataMap
Common\AbstractProjectExtensionProvider.cs (2)
30private ImmutableDictionary<string, ImmutableArray<TExtension>> _extensionsPerLanguage = ImmutableDictionary<string, ImmutableArray<TExtension>>.Empty;
Completion\CompletionChange.cs (6)
49internal ImmutableDictionary<string, string> Properties { get; } 53: this(textChange, textChanges, newPosition, includesCommitCharacter, ImmutableDictionary<string, string>.Empty) 58TextChange textChange, ImmutableArray<TextChange> textChanges, int? newPosition, bool includesCommitCharacter, ImmutableDictionary<string, string> properties) 64TextChange textChange, ImmutableArray<TextChange> textChanges, TextSpan? newSelection, bool includesCommitCharacter, ImmutableDictionary<string, string> properties) 124ImmutableDictionary<string, string> properties, 134ImmutableDictionary<string, string> properties,
Completion\CompletionItem.cs (8)
24private ImmutableDictionary<string, string>? _lazyPropertiesAsImmutableDictionary; 95public ImmutableDictionary<string, string> Properties 219ImmutableDictionary<string, string>? properties, 231ImmutableDictionary<string, string>? properties, 245ImmutableDictionary<string, string>? properties, 261ImmutableDictionary<string, string>? properties = null, 321ImmutableDictionary<string, string>? properties, 447public CompletionItem WithProperties(ImmutableDictionary<string, string> properties)
Completion\CompletionService.ProviderManager.cs (3)
29private readonly Lazy<ImmutableDictionary<string, CompletionProvider>> _nameToProvider; 40_nameToProvider = new Lazy<ImmutableDictionary<string, CompletionProvider>>(LoadImportedProvidersAndCreateNameMap, LazyThreadSafetyMode.PublicationOnly); 50private ImmutableDictionary<string, CompletionProvider> LoadImportedProvidersAndCreateNameMap()
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
57return CompletionChange.Create(change, changesArray, properties: ImmutableDictionary<string, string>.Empty, newSpan, includesCommitCharacter: true);
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (2)
60var props = ImmutableDictionary<string, string>.Empty
Completion\Providers\SymbolCompletionItem.cs (1)
310ImmutableDictionary<string, string>? properties = null,
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (3)
151ImmutableDictionary<IPropertySymbol, string> propertyMap, CancellationToken cancellationToken) 320private static (ImmutableArray<IPropertySymbol> properties, ImmutableDictionary<IPropertySymbol, string> propertyMap) GenerateProperties( 395semanticModel, parameters, parameterToPropMap, ImmutableDictionary<string, string>.Empty,
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
942semanticModel, parameters, parameterToPropMap, ImmutableDictionary<string, string>.Empty,
Copilot\ICopilotCodeAnalysisService.cs (2)
100Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync( 102ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties,
Diagnostics\DiagnosticAnalyzerTelemetry.cs (4)
46private ImmutableDictionary<Type, Data> _analyzerInfoMap; 49=> _analyzerInfoMap = ImmutableDictionary<Type, Data>.Empty; 61ImmutableDictionary<Type, Data> map; 65_analyzerInfoMap = ImmutableDictionary<Type, Data>.Empty;
Diagnostics\Service\DocumentAnalysisExecutor.cs (3)
36private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySyntaxDiagnostics; 37private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySemanticDiagnostics; 152private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetAnalysisResultAsync(DocumentAnalysisScope analysisScope, CancellationToken cancellationToken)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (10)
27private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticAnalysisResultsAsync( 37var result = await ComputeDiagnosticsForAnalyzersAsync(analyzers).ConfigureAwait(false); 52async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> RemoveCompilerSemanticErrorsIfProjectNotLoadedAsync( 53ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 87async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsForAnalyzersAsync( 92var result = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 117async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> MergeProjectDiagnosticAnalyzerDiagnosticsAsync( 119ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 163void UpdateAnalyzerTelemetryData(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> telemetry)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.HostAnalyzerInfo.cs (2)
33var analyzersPerReference = state.HostAnalyzers.GetOrCreateHostDiagnosticAnalyzersPerReference(language); 42ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersPerReference,
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
48public async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDiagnosticsAsync(
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (4)
29private ImmutableDictionary<HostAnalyzerInfoKey, HostAnalyzerInfo> _hostAnalyzerStateMap = ImmutableDictionary<HostAnalyzerInfoKey, HostAnalyzerInfo>.Empty; 35private ImmutableDictionary<ProjectId, ProjectAnalyzerInfo> _projectAnalyzerStateMap = ImmutableDictionary<ProjectId, ProjectAnalyzerInfo>.Empty;
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (1)
68var analyzersPerReference = solutionAnalyzers.CreateProjectDiagnosticAnalyzersPerReference(project);
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
108async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetOrComputeDiagnosticAnalysisResultsAsync(
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (2)
26private static async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDocumentDiagnosticsCoreAsync( 235ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> diagnosticsMap;
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (2)
36private static readonly ConditionalWeakTable<ProjectState, StrongBox<(Checksum checksum, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> diagnosticAnalysisResults)>> s_projectToForceAnalysisData = new(); 76async Task<(Checksum checksum, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> diagnosticAnalysisResults)> ComputeForceAnalyzeProjectAsync()
Diagnostics\Service\EngineV2\InProcOrRemoteHostAnalyzerRunner.cs (5)
104var builderMap = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>.Empty; 114var telemetry = ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>.Empty; 215private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Hydrate(ImmutableArray<(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics)> diagnosticByDocument, Project project)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
5251var additionalReverse = bodyMap.AdditionalReverseMapping;
EditAndContinue\ActiveStatementsMap.cs (6)
22new(ImmutableDictionary<string, ImmutableArray<ActiveStatement>>.Empty, 23ImmutableDictionary<ManagedInstructionId, ActiveStatement>.Empty); 45private ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>> _lazyOldDocumentActiveStatements; 56_lazyOldDocumentActiveStatements = ImmutableDictionary<SyntaxTree, ImmutableArray<UnmappedActiveStatement>>.Empty; 61ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> remapping) 127private static bool TryGetUpToDateSpan(ManagedActiveStatementDebugInfo activeStatementInfo, ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> remapping, out LinePositionSpan newSpan)
EditAndContinue\DebuggingSession.cs (5)
154nonRemappableRegions: ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty, 241internal void RestartEditSession(ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>? nonRemappableRegions, bool? inBreakState) 428private static ImmutableDictionary<K, ImmutableArray<V>> GroupToImmutableDictionary<K, V>(IEnumerable<IGrouping<K, V>> items) 513ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, 599ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>? newNonRemappableRegions = null;
EditAndContinue\DeclarationBodyMap.cs (4)
17ImmutableDictionary<SyntaxNode, SyntaxNode>.Empty); 22public ImmutableDictionary<SyntaxNode, SyntaxNode> AdditionalReverseMapping { get; } 27ImmutableDictionary<SyntaxNode, SyntaxNode> additionalReverseMapping) 37=> new(match.Matches, match.ReverseMatches, ImmutableDictionary<SyntaxNode, SyntaxNode>.Empty);
EditAndContinue\EditAndContinueService.cs (1)
223ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects,
EditAndContinue\EditSession.cs (5)
63internal readonly ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> NonRemappableRegions; 90ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> nonRemappableRegions, 840ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, 1241out var projectsToRestart, 1306ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> previousNonRemappableRegions,
EditAndContinue\EmitSolutionUpdateResults.cs (7)
34public required ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> ProjectsToRestart { get; init; } 76public static Data CreateFromInternalError(Solution solution, string errorMessage, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects) 104ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty, 130public required ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> ProjectsToRestart { get; init; } 146ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty, 186ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, 187out ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> projectsToRestart,
EditAndContinue\IEditAndContinueService.cs (1)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
EditAndContinue\Remote\IRemoteEditAndContinueService.cs (1)
30ValueTask<EmitSolutionUpdateResults.Data> EmitSolutionUpdateAsync(Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, CancellationToken cancellationToken);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
57ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects,
EditAndContinue\SolutionUpdate.cs (3)
19ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> projectsToRestart, 30public readonly ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> ProjectsToRestart = projectsToRestart; 44projectsToRestart: ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty,
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
39private readonly ImmutableDictionary<string, ImmutableArray<Lazy<TService, EmbeddedLanguageMetadata>>> _identifierToServices;
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionAnalyzer.cs (4)
29private static readonly ImmutableDictionary<string, string?> s_strictProperties = 30ImmutableDictionary<string, string?>.Empty.Add(StrictKey, ""); 88var properties = strictTree != null && strictTree.Diagnostics.Length == 0 90: ImmutableDictionary<string, string?>.Empty;
EmbeddedLanguages\RegularExpressions\RegexParser.CaptureInfoAnalyzer.cs (7)
32private readonly ImmutableDictionary<int, TextSpan>.Builder _captureNumberToSpan; 33private readonly ImmutableDictionary<string, TextSpan>.Builder _captureNameToSpan; 50public static (ImmutableDictionary<string, TextSpan>, ImmutableDictionary<int, TextSpan>) Analyze( 57private (ImmutableDictionary<string, TextSpan>, ImmutableDictionary<int, TextSpan>) Analyze( 197ImmutableDictionary<T, TextSpan>.Builder mapping,
EmbeddedLanguages\RegularExpressions\RegexParser.cs (6)
81private readonly ImmutableDictionary<string, TextSpan> _captureNamesToSpan; 82private readonly ImmutableDictionary<int, TextSpan> _captureNumbersToSpan; 91ImmutableDictionary<string, TextSpan> captureNamesToSpan, 92ImmutableDictionary<int, TextSpan> captureNumbersToSpan) : this() 144ImmutableDictionary<string, TextSpan>.Empty, 145ImmutableDictionary<int, TextSpan>.Empty).ParseTree();
EmbeddedLanguages\RegularExpressions\RegexTree.cs (4)
16ImmutableDictionary<string, TextSpan> captureNamesToSpan, 17ImmutableDictionary<int, TextSpan> captureNumbersToSpan) : EmbeddedSyntaxTree<RegexKind, RegexNode, RegexCompilationUnit>(text, root, diagnostics) 19public readonly ImmutableDictionary<string, TextSpan> CaptureNamesToSpan = captureNamesToSpan; 20public readonly ImmutableDictionary<int, TextSpan> CaptureNumbersToSpan = captureNumbersToSpan;
Extensions\ExtensionFolder.cs (11)
15using HandlerMap = ImmutableDictionary<string, IExtensionMessageHandlerWrapper>; 37private ImmutableDictionary<string, AsyncLazy<AssemblyMessageHandlers>> _assemblyFilePathToHandlers = ImmutableDictionary<string, AsyncLazy<AssemblyMessageHandlers>>.Empty; 70DocumentMessageHandlers: HandlerMap.Empty, 71WorkspaceMessageHandlers: HandlerMap.Empty, 80DocumentMessageHandlers: HandlerMap.Empty, 81WorkspaceMessageHandlers: HandlerMap.Empty, 90var documentMessageHandlers = factory 93var workspaceMessageHandlers = factory 107DocumentMessageHandlers: HandlerMap.Empty, 108WorkspaceMessageHandlers: HandlerMap.Empty,
Extensions\ExtensionMessageHandlerService.cs (6)
24ImmutableDictionary<string, IExtensionMessageHandlerWrapper> DocumentMessageHandlers, 25ImmutableDictionary<string, IExtensionMessageHandlerWrapper> WorkspaceMessageHandlers, 46private ImmutableDictionary<string, ExtensionFolder> _folderPathToExtensionFolder = ImmutableDictionary<string, ExtensionFolder>.Empty; 152ImmutableDictionary<string, ExtensionFolder> oldFolderPathToExtensionFolder; 156_folderPathToExtensionFolder = ImmutableDictionary<string, ExtensionFolder>.Empty;
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (2)
29ImmutableDictionary<string, string>? properties = null, 43ImmutableDictionary<string, string>? properties = null,
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (1)
98.EmitSolutionUpdateAsync(sessionId, solution, runningProjects: ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty, s_solutionActiveStatementSpanProvider, cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (3)
32private ImmutableDictionary<string, ImmutableArray<Lazy<IUnitTestingIncrementalAnalyzerProvider, UnitTestingIncrementalAnalyzerProviderMetadata>>> _analyzerProviders; 213ImmutableDictionary<string, ImmutableArray<Lazy<IUnitTestingIncrementalAnalyzerProvider, UnitTestingIncrementalAnalyzerProviderMetadata>>> analyzerProviders) 256internal ref ImmutableDictionary<string, ImmutableArray<Lazy<IUnitTestingIncrementalAnalyzerProvider, UnitTestingIncrementalAnalyzerProviderMetadata>>> AnalyzerProviders
ExternalAccess\Watch\Api\WatchHotReloadService.cs (3)
122public ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> ProjectsToRestart { get; init; } 203public async Task<Updates2> GetUpdatesAsync(Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, CancellationToken cancellationToken) 207var runningProjectsImpl = runningProjects.ToImmutableDictionary(
ExtractInterface\AbstractExtractInterfaceService.cs (2)
41ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 314ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap,
FindUsages\DefinitionItem.cs (7)
65public ImmutableDictionary<string, string> Properties { get; } 122ImmutableDictionary<string, string>? properties, 132Properties = properties ?? ImmutableDictionary<string, string>.Empty; 213ImmutableDictionary<string, string>? properties = null, 228ImmutableDictionary<string, string>? properties = null, 258ImmutableDictionary<string, string>? properties = null, 261properties ??= ImmutableDictionary<string, string>.Empty;
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
29ImmutableDictionary<string, string>? properties,
FindUsages\DefinitionItem.DetachedDefinitionItem.cs (2)
26ImmutableDictionary<string, string> properties, 41public readonly ImmutableDictionary<string, string> Properties = properties;
FindUsages\DefinitionItemFactory.cs (6)
121var properties = GetProperties(definition, isPrimary); 148internal static ImmutableDictionary<string, string> WithMetadataSymbolProperties(this ImmutableDictionary<string, string> properties, ISymbol symbol, ProjectId originatingProjectId) 255private static ImmutableDictionary<string, string> GetProperties(ISymbol definition, bool isPrimary) 257var properties = ImmutableDictionary<string, string>.Empty;
FindUsages\IRemoteFindUsagesService.cs (2)
190ImmutableDictionary<string, string> properties, 213public readonly ImmutableDictionary<string, string> Properties = properties;
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
584ImmutableDictionary<string, ISymbol>.Builder parameterToFieldMap, 585ImmutableDictionary<string, string>.Builder parameterToNewFieldMap)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
739properties: ImmutableDictionary<string, string>.Empty.WithMetadataSymbolProperties(symbol, originatingProjectId));
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (9)
105var renameTable = ComputeRenameTable( 224var replacementTable = ComputeReplacementTable( 251ImmutableDictionary<ISymbol, string> renameTable) 277ImmutableDictionary<ISymbol, string> renameTable, 289ImmutableDictionary<ISymbol, SyntaxNode> replacementTable, 322private ImmutableDictionary<ISymbol, SyntaxNode> ComputeReplacementTable( 325ImmutableDictionary<IParameterSymbol, TExpressionSyntax> parametersToReplace, 327ImmutableDictionary<ISymbol, string> renameTable) 351private static ImmutableDictionary<ISymbol, string> ComputeRenameTable(
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
28ImmutableDictionary<IParameterSymbol, TExpressionSyntax> parametersToReplace, 124public ImmutableDictionary<IParameterSymbol, TExpressionSyntax> ParametersToReplace { get; } = parametersToReplace;
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
221var newNameOriginalSymbolMapping = memberSymbols
MoveToNamespace\MoveToNamespaceResult.cs (2)
19public ImmutableDictionary<string, ISymbol> NewNameOriginalSymbolMapping { get; } 26ImmutableDictionary<string, ISymbol> newNameOriginalSymbolMapping)
PdbSourceDocument\DocumentDebugInfoReader.cs (1)
106public ImmutableDictionary<string, string> GetCompilationOptions()
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
179ImmutableDictionary<string, string> pdbCompilationOptions; 306private ProjectInfo? CreateProjectInfo(Workspace workspace, Project project, ImmutableDictionary<string, string> pdbCompilationOptions, string assemblyName, string assemblyVersion, SourceHashAlgorithm checksumAlgorithm) 484public ImmutableDictionary<string, SourceDocumentInfo> Documents => _instance._fileToDocumentInfoMap.ToImmutableDictionary();
PreferFrameworkType\PreferFrameworkTypeConstants.cs (2)
12public static readonly ImmutableDictionary<string, string?> Properties = 13ImmutableDictionary<string, string?>.Empty.Add(PreferFrameworkType, "");
PullMemberUp\MembersPuller.cs (3)
101var symbolToDeclarationsMap = await InitializeSymbolToDeclarationsMapAsync(pullMemberUpOptions, cancellationToken).ConfigureAwait(false); 282var symbolToDeclarations = await InitializeSymbolToDeclarationsMapAsync(result, cancellationToken).ConfigureAwait(false); 468private static async Task<ImmutableDictionary<ISymbol, ImmutableArray<SyntaxNode>>> InitializeSymbolToDeclarationsMapAsync(
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (5)
89var definitionToBackingField = CreateDefinitionToBackingFieldMap(propertyReferences); 115private static ImmutableDictionary<IPropertySymbol, IFieldSymbol?> CreateDefinitionToBackingFieldMap(IEnumerable<ReferencedSymbol> propertyReferences) 194ImmutableDictionary<IPropertySymbol, IFieldSymbol?> propertyToBackingField, 214ImmutableDictionary<IPropertySymbol, IFieldSymbol?> propertyToBackingField, 293ImmutableDictionary<IPropertySymbol, IFieldSymbol?> definitionToBackingField,
SemanticSearch\AbstractSemanticSearchService.cs (4)
73private static readonly ImmutableDictionary<Type, QueryKind> s_queryKindByParameterType = ImmutableDictionary<Type, QueryKind>.Empty 82private ImmutableDictionary<CompiledQueryId, CompiledQuery> _compiledQueries = ImmutableDictionary<CompiledQueryId, CompiledQuery>.Empty;
Shared\Utilities\AnnotatedSymbolMapping.cs (4)
16ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 18ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> documentIdsToSymbolMap, 25public ImmutableDictionary<ISymbol, SyntaxAnnotation> SymbolToDeclarationAnnotationMap { get; } = symbolToDeclarationAnnotationMap; 35public ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> DocumentIdsToSymbolMap { get; } = documentIdsToSymbolMap;
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (2)
33protected static readonly ImmutableDictionary<string, string?> ModifiersAddedProperties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (5)
25private static readonly Dictionary<(bool includeInFixAll, string equivalenceKey), ImmutableDictionary<string, string?>> s_cachedProperties = []; 37var properties = ImmutableDictionary<string, string?>.Empty; 70private static ImmutableDictionary<string, string?> GetProperties(bool includeInFixAll, string equivalenceKey) 172var properties = GetProperties(includeInFixAll, equivalenceKey);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
25public static readonly ImmutableDictionary<string, string?> s_isFixableProperties = 26ImmutableDictionary<string, string?>.Empty.Add(ForEachCastHelpers.IsFixable, ForEachCastHelpers.IsFixable);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (14)
35/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 45ImmutableDictionary<string, string?>? properties, 116return CreateWithMessage(descriptor, location, notificationOption, analyzerOptions, additionalLocations, ImmutableDictionary<string, string?>.Empty, message); 118var tagIndices = ImmutableDictionary<string, IEnumerable<int>>.Empty 128ImmutableDictionary<string, string?>.Empty); 162ImmutableDictionary<string, string?>? properties, 184ImmutableDictionary<string, string?>? properties) 189var tagIndices = ImmutableDictionary<string, IEnumerable<int>>.Empty 210ImmutableDictionary<string, string?>? properties) 215properties ??= ImmutableDictionary<string, string?>.Empty; 250/// <see cref="ImmutableDictionary{TKey, TValue}.Empty"/>. 260ImmutableDictionary<string, string?>? properties,
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
88properties: ImmutableDictionary<string, string?>.Empty.Add(MatchFolderAndNamespaceConstants.TargetNamespace, targetNamespace),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
69var properties = ImmutableDictionary<string, string?>.Empty
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (2)
99var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (2)
20private static readonly ImmutableDictionary<string, TargetScope> s_targetScopesMap = CreateTargetScopesMap(); 25private static ImmutableDictionary<string, TargetScope> CreateTargetScopesMap()
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (5)
19using PropertiesMap = ImmutableDictionary<(UnusedValuePreference preference, bool isUnusedLocalAssignment, bool isRemovableAssignment), 20ImmutableDictionary<string, string?>>; 93private static readonly PropertiesMap s_propertiesMap = CreatePropertiesMap(); 148private static PropertiesMap CreatePropertiesMap() 151ImmutableDictionary<string, string?>>();
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
214var properties = s_propertiesMap[(_options.UnusedValueExpressionStatementPreference, isUnusedLocalAssignment: false, isRemovableAssignment: false)]; 571if (ShouldReportUnusedValueDiagnostic(symbol, unreadWriteOperation, symbolUsageResult, out var properties)) 592out ImmutableDictionary<string, string?>? properties)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (9)
25private static readonly ImmutableDictionary<string, string?> s_takeCondition 26= ImmutableDictionary<string, string?>.Empty; 27private static readonly ImmutableDictionary<string, string?> s_negateCondition 29private static readonly ImmutableDictionary<string, string?> s_takeConditionOrWhenFalse 31private static readonly ImmutableDictionary<string, string?> s_negateConditionAndWhenFalse 33private static readonly ImmutableDictionary<string, string?> s_negateConditionOrWhenTrue 35private static readonly ImmutableDictionary<string, string?> s_takeConditionAndWhenTrue 37private static readonly ImmutableDictionary<string, string?> s_takeConditionAndWhenFalse 138void ReportDiagnostic(ImmutableDictionary<string, string?> properties)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
652var properties = ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (3)
182var properties = shouldUseCollectionExpression ? UseCollectionInitializerHelpers.UseCollectionExpressionProperties : ImmutableDictionary<string, string?>.Empty; 243ImmutableDictionary<string, string?>? properties)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (2)
19public static readonly ImmutableDictionary<string, string?> UseCollectionExpressionProperties = 20ImmutableDictionary<string, string?>.Empty.Add(UseCollectionExpressionName, UseCollectionExpressionName);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
29private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _binaryToAssignmentMap;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
21out ImmutableDictionary<TSyntaxKind, TSyntaxKind> binaryToAssignmentMap, 22out ImmutableDictionary<TSyntaxKind, TSyntaxKind> assignmentToTokenMap) where TSyntaxKind : struct
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (2)
20public static readonly ImmutableDictionary<string, string?> CanSimplifyProperties = 21ImmutableDictionary<string, string?>.Empty.Add(CanSimplifyName, CanSimplifyName);
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
61var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
107var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
66private static readonly ImmutableDictionary<string, string?> s_whenPartIsNullableProperties = 67ImmutableDictionary<string, string?>.Empty.Add(UseNullPropagationHelpers.WhenPartIsNullable, ""); 192var properties = whenPartIsNullable 194: ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (2)
119var properties = whenPartIsNullable 121: ImmutableDictionary<string, string?>.Empty;
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
85ImmutableDictionary<string, string?>.Empty));
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
49private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 51public ImmutableDictionary<string, string> ParameterToNewFieldMap { get; private set; } 52public ImmutableDictionary<string, string> ParameterToNewPropertyMap { get; private set; } 61ParameterToNewFieldMap = ImmutableDictionary<string, string>.Empty; 62ParameterToNewPropertyMap = ImmutableDictionary<string, string>.Empty; 484var newMemberMap = 487ImmutableDictionary<string, string>.Empty;
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (3)
132ImmutableDictionary<string, ISymbol> parameterToExistingMemberMap, 133ImmutableDictionary<string, string> parameterToNewFieldMap, 134ImmutableDictionary<string, string> parameterToNewPropertyMap)> GetParametersAsync<TExpressionSyntax>(
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
56var properties = diagnostic.Properties;
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
33ImmutableDictionary<string, string?> properties,
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
64ImmutableDictionary<string, string?> properties,
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
28private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _binaryToAssignmentMap; 29private readonly ImmutableDictionary<TSyntaxKind, TSyntaxKind> _assignmentToTokenMap;
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
67ImmutableDictionary<string, string?> properties,
Structure\Syntax\AbstractBlockStructureProvider.cs (4)
21private readonly ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> _nodeProviderMap; 22private readonly ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> _triviaProviderMap; 25ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> defaultNodeOutlinerMap, 26ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> defaultTriviaOutlinerMap)
Structure\Syntax\BlockSpanCollector.cs (6)
16private readonly ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> _nodeProviderMap; 17private readonly ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> _triviaProviderMap; 22ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> nodeOutlinerMap, 23ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> triviaOutlinerMap, 35ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> nodeOutlinerMap, 36ImmutableDictionary<int, ImmutableArray<AbstractSyntaxStructureProvider>> triviaOutlinerMap,
Structure\Syntax\BlockStructureExtensions.cs (1)
13this ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>>.Builder builder)
SyncNamespaces\AbstractSyncNamespacesService.cs (5)
42var diagnosticsByProject = await GetDiagnosticsByProjectAsync(projects, diagnosticAnalyzers, IsHostAnalyzer, cancellationToken).ConfigureAwait(false); 58private static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetDiagnosticsByProjectAsync( 98ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 156private readonly ImmutableDictionary<Project, ImmutableArray<Diagnostic>> _diagnosticsByProject; 158internal DiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject)
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (5)
57var targetLibraryKeys = projectAssets.Targets 74ImmutableDictionary<string, ImmutableDictionary<string, string>> targetLibraryKeys, 99ImmutableDictionary<string, ImmutableDictionary<string, string>> targetLibraryKeys,
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\ActiveStatementTestHelpers.cs (1)
107public static IEnumerable<string> InspectNonRemappableRegions(ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> regions)
EditAndContinue\MockEditAndContinueService.cs (2)
26public Func<Solution, ImmutableDictionary<ProjectId, RunningProjectInfo>, ActiveStatementSpanProvider, EmitSolutionUpdateResults>? EmitSolutionUpdateImpl; 46public ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
Snippets\AbstractSnippetProviderTests.cs (1)
75TestFileMarkupParser.GetPositionAndSpans(markupAfterCommit, out markupAfterCommit, out int finalCaretPosition, out ImmutableDictionary<string, ImmutableArray<TextSpan>> placeholderLocations);
Microsoft.CodeAnalysis.Features.UnitTests (43)
EditAndContinue\ActiveStatementsMapTests.cs (6)
141var map = ActiveStatementsMap.Create(debugInfos, remapping: ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty); 191var map = ActiveStatementsMap.Create(debugInfos, remapping: ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty); 302var remapping = ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty.Add( 340var remapping = ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty.Add(
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (5)
3056var runningProjects = ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty 4886var result1 = await encService.EmitSolutionUpdateAsync(sessionId, solution1, runningProjects: ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty, s_noActiveSpans, CancellationToken.None); 4893var result2 = await encService.EmitSolutionUpdateAsync(sessionId, solution2, runningProjects: ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty, s_noActiveSpans, CancellationToken.None); 4916await Assert.ThrowsAsync<ObjectDisposedException>(async () => await debuggingSession.EmitSolutionUpdateAsync(solution, runningProjects: ImmutableDictionary<ProjectId, RunningProjectInfo>.Empty, s_noActiveSpans, CancellationToken.None));
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
36ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>> nonRemappableRegions = null, 64debuggingSession.RestartEditSession(nonRemappableRegions ?? ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty, inBreakState: true); 274previousNonRemappableRegions: ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty, 385previousNonRemappableRegions: ImmutableDictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>.Empty, 504var initialNonRemappableRegions = new Dictionary<ManagedMethodId, ImmutableArray<NonRemappableRegion>>
EditAndContinue\EmitSolutionUpdateResultsTests.cs (19)
57private static ImmutableDictionary<ProjectId, RunningProjectInfo> CreateRunningProjects(IEnumerable<(ProjectId id, bool noEffectRestarts)> projectIds, bool allowPartialUpdate = true) 60private static IEnumerable<string> Inspect(ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>> projectsToRestart) 92properties: ImmutableDictionary<string, string?>.Empty, 108properties: ImmutableDictionary<string, string?>.Empty, 125properties: ImmutableDictionary<string, string?>.Empty, 145ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty, 176out var projectsToRestart, 199out var projectsToRestart, 224out var projectsToRestart, 254out var projectsToRestart, 280out var projectsToRestart, 313out var projectsToRestart, 340out var projectsToRestart, 363out var projectsToRestart, 397out var projectsToRestart, 445out var projectsToRestart, 476out var projectsToRestart, 514out var projectsToRestart, 562out var projectsToRestart,
EditAndContinue\RemoteEditAndContinueServiceTests.cs (2)
176var runningProjects1 = new Dictionary<ProjectId, RunningProjectInfo> 218ProjectsToRestart = ImmutableDictionary<ProjectId, ImmutableArray<ProjectId>>.Empty.Add(project.Id, []),
EditAndContinue\WatchHotReloadServiceTests.cs (6)
90var result = await hotReload.GetUpdatesAsync(solution, runningProjects: ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty, CancellationToken.None); 107result = await hotReload.GetUpdatesAsync(solution, runningProjects: ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty, CancellationToken.None); 119var runningProjects = ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty 226var runningProjects = ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty
Microsoft.CodeAnalysis.InteractiveHost (17)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.LanguageServer (19)
BrokeredServices\BrokeredServiceBridgeProvider.cs (1)
55var serviceBroker = container.GetLimitedAccessServiceBroker(ServiceAudience.Local, ImmutableDictionary<string, string>.Empty, ClientCredentialsPolicy.RequestOverridesDefault);
BrokeredServices\BrokeredServiceContainer.cs (4)
18: base(ImmutableDictionary<ServiceMoniker, ServiceRegistration>.Empty, isClientOfExclusiveServer: false, joinableTaskFactory: null, traceSource) 23=> ImmutableDictionary<string, string>.Empty; 33internal ImmutableDictionary<ServiceMoniker, ServiceRegistration> GetRegisteredServices() 71return new(ImmutableDictionary<string, string>.Empty);
BrokeredServices\Services\Descriptors.cs (1)
40public static ImmutableDictionary<ServiceMoniker, ServiceRegistration> RemoteServicesToRegister = new Dictionary<ServiceMoniker, ServiceRegistration>
HostWorkspace\LanguageServerProjectLoader.cs (3)
41protected readonly ImmutableDictionary<string, string> AdditionalProperties; 110? ImmutableDictionary<string, string>.Empty 111: ImmutableDictionary<string, string>.Empty.Add("RazorDesignTimeTargets", razorDesignTimePath);
HostWorkspace\ProjectDependencyHelper.cs (3)
71var projectAssetsMap = CreateProjectAssetsMap(lockFile); 107static ImmutableDictionary<string, ImmutableArray<NuGetVersion>> CreateProjectAssetsMap(LockFile lockFile) 110var map = lockFile.Libraries
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (2)
68var fileCounts = GetUniqueHashedFileExtensionsAndCounts(projectFileInfo); 99private static ImmutableDictionary<string, int> GetUniqueHashedFileExtensionsAndCounts(ProjectFileInfo projectFileInfo)
LanguageServer\Handler\CopilotCompletion\ContextResolveParam.cs (1)
32return ImmutableDictionary<string, object>.Empty;
Services\ExtensionAssemblyManager.cs (4)
33private readonly ImmutableDictionary<string, AssemblyLoadContext> _directoryLoadContexts; 35private readonly ImmutableDictionary<string, AssemblyLoadContext> _assemblyFullNameToLoadContext; 39public ExtensionAssemblyManager(ImmutableDictionary<string, AssemblyLoadContext> directoryLoadContexts, 40ImmutableDictionary<string, AssemblyLoadContext> assemblyFullNameToLoadContext,
Microsoft.CodeAnalysis.LanguageServer.Protocol (34)
Extensions\ProtocolConversions.cs (2)
54public static readonly ImmutableDictionary<string, ImmutableArray<LSP.CompletionItemKind>> RoslynTagToCompletionItemKinds = new Dictionary<string, ImmutableArray<LSP.CompletionItemKind>>() 101public static readonly ImmutableDictionary<string, ImmutableArray<LSP.CompletionItemTag>> RoslynTagToCompletionItemTags = new Dictionary<string, ImmutableArray<LSP.CompletionItemTag>>()
Features\Options\SolutionAnalyzerConfigOptionsUpdater.cs (3)
53var oldFallbackOptions = oldSolution.FallbackAnalyzerOptions; 54var newFallbackOptions = oldFallbackOptions; 58ImmutableDictionary<string, string>.Builder? lazyBuilder = null;
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
281ImmutableDictionary<CodeFixGroupKey, IList<IUnifiedSuggestedAction>> map,
Handler\AbstractRefreshQueue.cs (1)
113var trackedDocuments = lspWorkspaceManager.GetTrackedLspText();
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (2)
42private static readonly ImmutableDictionary<string, string> s_languageNameToPrefix = ImmutableDictionary<string, string>.Empty
Handler\Diagnostics\BuildOnlyDiagnosticIdsHandler.cs (1)
34private readonly ImmutableDictionary<string, string[]> _compilerBuildOnlyDiagnosticIds = compilerBuildOnlyDiagnosticsProviders
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (3)
28private readonly ImmutableDictionary<string, IDiagnosticSourceProvider> _nameToDocumentProviderMap; 33private readonly ImmutableDictionary<string, IDiagnosticSourceProvider> _nameToWorkspaceProviderMap; 63ImmutableDictionary<string, IDiagnosticSourceProvider> nameToProviderMap,
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (7)
23private static readonly ImmutableDictionary<string, string?> s_lowPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, Low); 24private static readonly ImmutableDictionary<string, string?> s_mediumPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, Medium); 25private static readonly ImmutableDictionary<string, string?> s_highPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, High); 64private static ImmutableDictionary<string, string?> GetProperties(TaskListItemPriority priority)
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
252private static async Task<(string ReplacedSnippetText, ImmutableDictionary<SnippetFieldPart, ImmutableArray<TextSpan>> Fields, TextSpan? CaretSpan)> GetReplacedSnippetTextAsync(
Handler\RequestContext.cs (3)
45private readonly ImmutableDictionary<DocumentUri, (SourceText Text, string LanguageId)> _trackedDocuments; 179ImmutableDictionary<DocumentUri, (SourceText Text, string LanguageId)> trackedDocuments, 245var trackedDocuments = lspWorkspaceManager.GetTrackedLspText();
Handler\SemanticTokens\CustomLspSemanticTokenNames.cs (1)
84public static ImmutableDictionary<string, string> ClassificationTypeNameToCustomTokenName = new Dictionary<string, string>
Handler\SemanticTokens\SemanticTokensSchema.cs (3)
23private static readonly ImmutableDictionary<string, string> s_vsDirectTypeMap = new Dictionary<string, string>() 38private static readonly ImmutableDictionary<string, string> s_pureLspDirectTypeMap = s_vsDirectTypeMap.Concat(new Dictionary<string, string> 81public static readonly ImmutableDictionary<string, TokenModifiers> AdditiveClassificationTypeToTokenModifier = new Dictionary<string, TokenModifiers>()
Workspaces\LspWorkspaceManager.cs (6)
66private ImmutableDictionary<DocumentUri, (SourceText Text, string LanguageId)> _trackedDocuments = ImmutableDictionary<DocumentUri, (SourceText SourceText, string LanguageId)>.Empty; 214public ImmutableDictionary<DocumentUri, (SourceText SourceText, string LanguageId)> GetTrackedLspText() => _trackedDocuments; 381var documentsInWorkspace = GetDocumentsForUris([.. _trackedDocuments.Keys], workspaceCurrentSolution); 492private async Task<bool> DoesAllTextMatchWorkspaceSolutionAsync(ImmutableDictionary<DocumentUri, ImmutableArray<TextDocument>> documentsInWorkspace, CancellationToken cancellationToken) 545private static ImmutableDictionary<DocumentUri, ImmutableArray<TextDocument>> GetDocumentsForUris(ImmutableArray<DocumentUri> trackedDocuments, Solution workspaceCurrentSolution)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
118=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, [DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp), new MockAdditionalFileDiagnosticAnalyzer()]));
Diagnostics\DiagnosticsPullCacheTests.cs (1)
124isEnabledByDefault: true, warningLevel: 0, [], ImmutableDictionary<string, string?>.Empty,context.Document!.Project.Id,
Diagnostics\NonLocalDiagnosticTests.cs (1)
71=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, [DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp), new NonLocalDiagnosticsAnalyzer()]));
Diagnostics\PullDiagnosticTests.cs (1)
1335properties: ImmutableDictionary<string, string?>.Empty,
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
67=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, [DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp), new MockProjectDiagnosticAnalyzer()]));
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (1)
282var optionsAfterProjectAdded = workspace.CurrentSolution.FallbackAnalyzerOptions;
ProtocolConversionsTests.cs (1)
180var map = ProtocolConversions.RoslynTagToCompletionItemKinds;
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Utilities\AbstractLanguageServerClientTests.cs (2)
40ImmutableDictionary<string, ImmutableArray<TextSpan>> spans; 95private protected static Dictionary<string, IList<LSP.Location>> GetAnnotatedLocations(DocumentUri codeUri, SourceText text, ImmutableDictionary<string, ImmutableArray<TextSpan>> spanMap)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (117)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Microsoft.CodeAnalysis.PooledObjects.Package (3)
PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.PublicApiAnalyzers (120)
DeclarePublicApiAnalyzer.cs (7)
117if (!TryGetAndValidateApiFiles(context, isPublic, errors, out var additionalFiles, out var shippedData, out var unshippedData)) 135bool TryGetAndValidateApiFiles(CompilationStartAnalysisContext context, bool isPublic, List<Diagnostic> errors, [NotNullWhen(true)] out ImmutableDictionary<AdditionalText, SourceText>? additionalFiles, [NotNullWhen(true)] out ApiData? shippedData, [NotNullWhen(true)] out ApiData? unshippedData) 198private static bool TryGetApiData(CompilationStartAnalysisContext context, bool isPublic, List<Diagnostic> errors, [NotNullWhen(true)] out ImmutableDictionary<AdditionalText, SourceText>? additionalFiles, [NotNullWhen(true)] out ApiData? shippedData, [NotNullWhen(true)] out ApiData? unshippedData) 351out ImmutableDictionary<AdditionalText, SourceText> additionalFiles, 355additionalFiles = ImmutableDictionary<AdditionalText, SourceText>.Empty; 381private static bool ValidateApiFiles(ImmutableDictionary<AdditionalText, SourceText> additionalFiles, ApiData shippedData, ApiData unshippedData, bool isPublic, List<Diagnostic> errors) 409private static void ValidateApiList(ImmutableDictionary<AdditionalText, SourceText> additionalFiles, Dictionary<string, ApiLine> publicApiMap, ImmutableArray<ApiLine> apiList, bool isPublic, List<Diagnostic> errors)
DeclarePublicApiAnalyzer.Impl.cs (19)
30public string GetPath(ImmutableDictionary<AdditionalText, SourceText> additionalFiles) 49public string GetPath(ImmutableDictionary<AdditionalText, SourceText> additionalFiles) 52public Location GetLocation(ImmutableDictionary<AdditionalText, SourceText> additionalFiles) 79private readonly ImmutableDictionary<AdditionalText, SourceText> _additionalFiles; 89internal Impl(Compilation compilation, ImmutableDictionary<AdditionalText, SourceText> additionalFiles, ApiData shippedData, ApiData unshippedData, bool isPublic, AnalyzerOptions analyzerOptions) 300reportDiagnosticAtLocations(GetDiagnostic(ShouldAnnotatePublicApiFilesRule, ShouldAnnotateInternalApiFilesRule), ImmutableDictionary<string, string?>.Empty); 321ImmutableDictionary<string, string?> propertyBag = ImmutableDictionary<string, string?>.Empty; 358reportDiagnosticAtLocations(diagnostic, ImmutableDictionary<string, string?>.Empty, errorMessageName, diagnostic.HelpLinkUri); 371reportDiagnosticAtLocations(diagnostic, ImmutableDictionary<string, string?>.Empty, errorMessageName, diagnostic.HelpLinkUri); 383reportDiagnosticAtLocations(diagnostic, ImmutableDictionary<string, string?>.Empty, errorMessageName, diagnostic.HelpLinkUri); 395void reportDiagnosticAtLocations(DiagnosticDescriptor descriptor, ImmutableDictionary<string, string?> propertyBag, params object[] args) 416ImmutableDictionary<string, string?> propertyBag = ImmutableDictionary<string, string?>.Empty 428ImmutableDictionary<string, string?> propertyBag = ImmutableDictionary<string, string?>.Empty 448reportDiagnosticAtLocations(GetDiagnostic(ObliviousPublicApiRule, ObliviousInternalApiRule), ImmutableDictionary<string, string?>.Empty, errorMessageName); 766ImmutableDictionary<string, string?> propertyBag = ImmutableDictionary<string, string?>.Empty.Add(ApiNamePropertyBagKey, pair.Value.Text);
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
DeterministicKeyBuilderTests.cs (1)
402var map = values.ToImmutableDictionary(
Microsoft.CodeAnalysis.Remote.ServiceHub (17)
Host\AssetProvider.cs (1)
113tasks.Add(this.GetAssetAsync<ImmutableDictionary<string, StructuredAnalyzerConfigOptions>>(
Host\RemoteWorkspace.SolutionCreator.cs (1)
82solution = solution.WithFallbackAnalyzerOptions(await _assetProvider.GetAssetAsync<ImmutableDictionary<string, StructuredAnalyzerConfigOptions>>(
Services\ClientOptionsProvider.cs (2)
16private ImmutableDictionary<string, AsyncLazy<TOptions>> _cache = ImmutableDictionary<string, AsyncLazy<TOptions>>.Empty;
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (3)
206var builderMap = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>.Empty; 222ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder> builderMap,
Services\EditAndContinue\RemoteEditAndContinueService.cs (1)
144Checksum solutionChecksum, RemoteServiceCallbackId callbackId, DebuggingSessionId sessionId, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, CancellationToken cancellationToken)
src\VisualStudio\Core\Def\Telemetry\Shared\AbstractAggregatingLog.cs (3)
32private ImmutableDictionary<string, (TAggregator aggregator, TelemetryEvent TelemetryEvent, object Lock)> _aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty; 126_aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty;
src\VisualStudio\Core\Def\Telemetry\Shared\TelemetryLogProvider.cs (6)
23private ImmutableDictionary<FunctionId, VisualStudioTelemetryLog> _logs = ImmutableDictionary<FunctionId, VisualStudioTelemetryLog>.Empty; 28private ImmutableDictionary<FunctionId, AggregatingHistogramLog> _histogramLogs = ImmutableDictionary<FunctionId, AggregatingHistogramLog>.Empty; 33private ImmutableDictionary<FunctionId, AggregatingCounterLog> _counterLogs = ImmutableDictionary<FunctionId, AggregatingCounterLog>.Empty;
Microsoft.CodeAnalysis.Remote.Workspaces (7)
AbstractAssetProvider.cs (1)
60var fallbackAnalyzerOptions = await GetAssetAsync<ImmutableDictionary<string, StructuredAnalyzerConfigOptions>>(AssetPathKind.SolutionFallbackAnalyzerOptions, solutionChecksums.FallbackAnalyzerOptions, cancellationToken).ConfigureAwait(false);
ExternalAccess\Pythia\Api\PythiaRemoteServiceCallbackDispatcherRegistry.cs (1)
16private readonly ImmutableDictionary<Type, PythiaRemoteServiceCallbackDispatcher> _lazyDispatchers;
ExternalAccess\UnitTesting\Api\UnitTestingRemoteServiceCallbackDispatcherRegistry.cs (1)
16private readonly ImmutableDictionary<Type, UnitTestingRemoteServiceCallbackDispatcher> _lazyDispatchers;
ServiceDescriptors.cs (2)
96private readonly ImmutableDictionary<Type, (ServiceDescriptor descriptorCoreClr64, ServiceDescriptor descriptorCoreClr64ServerGC)> _descriptors; 172public ImmutableDictionary<Type, (ServiceDescriptor descriptorCoreClr64, ServiceDescriptor descriptorCoreClr64ServerGC)> Descriptors
VisualStudioMefHostServices.cs (2)
23private ImmutableDictionary<ExportKey, IEnumerable> _exportsMap 24= ImmutableDictionary<ExportKey, IEnumerable>.Empty;
Microsoft.CodeAnalysis.ResxSourceGenerator (100)
AbstractResxGenerator.cs (6)
152var remappedNames = ImmutableDictionary<string, string>.Empty; 279private sealed class ImmutableDictionaryEqualityComparer<TKey, TValue> : IEqualityComparer<ImmutableDictionary<TKey, TValue>?> 284public bool Equals(ImmutableDictionary<TKey, TValue>? x, ImmutableDictionary<TKey, TValue>? y) 310public int GetHashCode(ImmutableDictionary<TKey, TValue>? obj)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpVerifierHelper.cs (2)
22internal static ImmutableDictionary<string, ReportDiagnostic> NullableWarnings { get; } = GetNullableWarningsFromCompiler(); 24private static ImmutableDictionary<string, ReportDiagnostic> GetNullableWarningsFromCompiler()
Microsoft.CodeAnalysis.Scripting (4)
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (4)
35internal ImmutableDictionary<string, string> TrustedPlatformAssemblies; 84ImmutableDictionary<string, string> trustedPlatformAssemblies, 203internal static ImmutableDictionary<string, string> GetTrustedPlatformAssemblies(ImmutableArray<string> paths) 207return ImmutableDictionary<string, string>.Empty;
Microsoft.CodeAnalysis.Scripting.UnitTests (2)
RuntimeMetadataReferenceResolverTests.cs (2)
31packageResolver: new PackageResolver(ImmutableDictionary<string, ImmutableArray<string>>.Empty.Add("nuget:N/1.0", ImmutableArray.Create(assembly1.Path, assembly2.Path))), 33trustedPlatformAssemblies: ImmutableDictionary<string, string>.Empty);
Microsoft.CodeAnalysis.Test.Utilities (17)
Compilation\CompilationTestDataExtensions.cs (3)
48private static bool TryGetMethodData(ImmutableDictionary<string, CompilationTestData.MethodData> map, string qualifiedMethodName, out CompilationTestData.MethodData methodData) 82var map = data.GetMethodsByName(); 88var map = data.GetMethodsByName();
CompilationVerifier.cs (1)
772var documentMap = ILValidation.GetDocumentIdToPathMap(xmlDocument);
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
53private static readonly ImmutableDictionary<string, string> s_properties =
Diagnostics\DiagnosticExtensions.cs (2)
401public static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetCompilerDiagnosticAnalyzersMap() 415public static ImmutableDictionary<string, ImmutableArray<AnalyzerReference>> GetCompilerDiagnosticAnalyzerReferencesMap()
MarkedSource\SourceWithMarkedNodes.cs (4)
107public ImmutableDictionary<SyntaxNode, int> MapSyntaxNodesToMarks() 112public ImmutableDictionary<int, SyntaxNode> MapMarksToSyntaxNodes() 135var map0 = source0.MapMarksToSyntaxNodes(); 136var map1 = source1.MapSyntaxNodesToMarks();
Metadata\ILValidation.cs (1)
389public static ImmutableDictionary<string, string> GetDocumentIdToPathMap(XElement document)
PDB\DeterministicBuildCompilationTestHelpers.cs (3)
25public static void VerifyPdbOption<T>(this ImmutableDictionary<string, string> pdbOptions, string pdbName, T expectedValue, Func<T, bool> isDefault = null, Func<T, string> toString = null) 47internal static void AssertCommonOptions(EmitOptions emitOptions, CompilationOptions compilationOptions, Compilation compilation, ImmutableDictionary<string, string> pdbOptions) 152public static ImmutableDictionary<string, string> ParseCompilationOptions(BlobReader blobReader)
TestHelpers.cs (2)
30public static ImmutableDictionary<K, V> CreateImmutableDictionary<K, V>( 35public static ImmutableDictionary<K, V> CreateImmutableDictionary<K, V>(params (K key, V value)[] entries)
Microsoft.CodeAnalysis.Threading.Package (16)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.UnitTests (5)
Analyzers\AnalyzerConfigTests.cs (2)
1265var treeOptions = options[i].TreeOptions; 1537Assert.Equal(new ImmutableDictionary<string, ReportDiagnostic>[]
Analyzers\DictionaryAnalyzerConfigOptionsTests.cs (1)
25typeof(ImmutableDictionary<string, string>),
Collections\TestExtensionsMethods.nonnetstandard.cs (2)
34ImmutableDictionary<TKey, TValue> d => d.ToBuilder(), 47ImmutableDictionary<TKey, TValue> d => d.KeyComparer,
Microsoft.CodeAnalysis.VisualBasic (70)
Binding\DescendantBinderFactory.vb (4)
59Private _lazyNodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 62Friend ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 71Private _lazyStmtListToBinderMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder) 74Friend ReadOnly Property StmtListToBinderMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder)
Binding\ExecutableCodeBinder.vb (2)
178Public ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 185Friend ReadOnly Property StmtListToBinderMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder)
Binding\LocalBinderBuilder.vb (6)
29Private _nodeMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 30Private _listMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder) 40Public Sub New(enclosingMethod As MethodSymbol, nodeMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder), listMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder)) 53Public ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 59Public ReadOnly Property StmtListToBinderMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder)
CommandLine\VisualBasicCommandLineParser.vb (3)
1791diagnosticBuilder As ArrayBuilder(Of Diagnostic)) As ImmutableDictionary(Of String, InternalSyntax.CConst) 1814Private Shared Function InternalDefinesToPublicSymbols(defines As ImmutableDictionary(Of String, InternalSyntax.CConst)) As IReadOnlyDictionary(Of String, Object) 1844Dim defines As ImmutableDictionary(Of String, InternalSyntax.CConst) = PublicSymbolsToInternalDefines(symbols, diagnosticBuilder)
Compilation\VisualBasicCompilation.vb (8)
91Private ReadOnly _syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer) 103Private ReadOnly _rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry) 422syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 423rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 528syntaxTreeOrdinalMap As ImmutableDictionary(Of SyntaxTree, Integer), 529rootNamespaces As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 981ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry), 1050ByRef declMap As ImmutableDictionary(Of SyntaxTree, DeclarationTableEntry),
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
115Dim assemblyReferenceIdentityMap As ImmutableDictionary(Of AssemblyIdentity, AssemblyIdentity) = Nothing
Errors\ErrorFactories.vb (3)
18Private Shared ReadOnly s_categoriesMap As Lazy(Of ImmutableDictionary(Of ERRID, String)) = New Lazy(Of ImmutableDictionary(Of ERRID, String))(AddressOf CreateCategoriesMap) 20Private Shared Function CreateCategoriesMap() As ImmutableDictionary(Of ERRID, String)
Preprocessor\ExpressionEvaluator.vb (4)
17Private ReadOnly _symbols As ImmutableDictionary(Of String, CConst) 112Private Sub New(symbols As ImmutableDictionary(Of String, CConst)) 117Optional symbols As ImmutableDictionary(Of String, CConst) = Nothing) As CConst 132Optional symbols As ImmutableDictionary(Of String, CConst) = Nothing) As CConst
Scanner\Directives.vb (4)
269Private ReadOnly _symbols As ImmutableDictionary(Of String, CConst) 275Friend Sub New(symbols As ImmutableDictionary(Of String, CConst)) 281Private Sub New(symbols As ImmutableDictionary(Of String, CConst), 294Friend ReadOnly Property SymbolsMap As ImmutableDictionary(Of String, CConst)
Scanner\Scanner.vb (2)
150Friend Shared Function GetPreprocessorConstants(options As VisualBasicParseOptions) As ImmutableDictionary(Of String, CConst) 152Return ImmutableDictionary(Of String, CConst).Empty
Symbols\ReferenceManager.vb (2)
209Friend Function CreatePEAssemblyForAssemblyMetadata(metadata As AssemblyMetadata, importOptions As MetadataImportOptions, <Out> ByRef assemblyReferenceIdentityMap As ImmutableDictionary(Of AssemblyIdentity, AssemblyIdentity)) As PEAssemblySymbol 328ImmutableDictionary(Of AssemblyIdentity, PortableExecutableReference).Empty)
Syntax\SyntaxNodeFactories.vb (2)
76Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, 89Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing,
Syntax\VisualBasicSyntaxTree.ConditionalSymbolsMap.vb (6)
28Private ReadOnly _conditionalsMap As ImmutableDictionary(Of String, Stack(Of Tuple(Of InternalSyntax.CConst, Integer))) 35Private Sub New(conditionalsMap As ImmutableDictionary(Of String, Stack(Of Tuple(Of InternalSyntax.CConst, Integer)))) 58Dim conditionalSymbolsMap As ImmutableDictionary(Of String, Stack(Of Tuple(Of InternalSyntax.CConst, Integer))) = symbolsMapBuilder.Build(syntaxRoot, options) 67Friend Function Build(root As SyntaxNodeOrToken, options As VisualBasicParseOptions) As ImmutableDictionary(Of String, Stack(Of Tuple(Of InternalSyntax.CConst, Integer))) 71Dim preprocessorSymbolsMap As ImmutableDictionary(Of String, InternalSyntax.CConst) = Scanner.GetPreprocessorConstants(options) 83Private Sub ProcessCommandLinePreprocessorSymbols(preprocessorSymbolsMap As ImmutableDictionary(Of String, InternalSyntax.CConst))
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (2)
55Public Overrides ReadOnly Property DiagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 98Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (4)
20Private ReadOnly _diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 29diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic)) 101Public Overrides ReadOnly Property DiagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 153Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (4)
29Private ReadOnly _diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 43diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic), 126Public Overrides ReadOnly Property DiagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 173Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Syntax\VisualBasicSyntaxTree.vb (5)
167Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing) As SyntaxTree 242Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, 252Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, 269Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, 285Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing,
VisualBasicCompilationOptions.vb (3)
815Protected Overrides Function CommonWithSpecificDiagnosticOptions(specificDiagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic)) As CompilationOptions 854Public Shadows Function WithSpecificDiagnosticOptions(value As ImmutableDictionary(Of String, ReportDiagnostic)) As VisualBasicCompilationOptions 856value = ImmutableDictionary(Of String, ReportDiagnostic).Empty
VisualBasicParseOptions.vb (5)
22Private _features As ImmutableDictionary(Of String, String) 45ImmutableDictionary(Of String, String).Empty) 53features As ImmutableDictionary(Of String, String)) 60_features = If(features, ImmutableDictionary(Of String, String).Empty) 233Return New VisualBasicParseOptions(Me) With {._features = ImmutableDictionary(Of String, String).Empty}
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (14)
CompilationContext.vb (5)
36Private ReadOnly _displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable) 114_displayClassVariables = ImmutableDictionary(Of String, DisplayClassVariable).Empty 975displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable)) As ImmutableArray(Of LocalSymbol) 1051<Out> ByRef displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable)) 1124displayClassVariables = ImmutableDictionary(Of String, DisplayClassVariable).Empty
Rewriters\CapturedVariableRewriter.vb (3)
14displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable), 23Private ReadOnly _displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable) 28displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable),
Symbols\EEMethodSymbol.vb (4)
36Private ReadOnly _displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable) 60sourceDisplayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable), 150oldDisplayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable), 153typeMap As TypeSubstitution) As ImmutableDictionary(Of String, DisplayClassVariable)
VisualBasicExpressionCompiler.vb (1)
159Dim assemblyContexts = If(previous.Matches(metadataBlocks), previous.AssemblyContexts, ImmutableDictionary(Of MetadataContextId, VisualBasicMetadataContext).Empty)
VisualBasicInstructionDecoder.vb (1)
99Dim assemblyContexts = If(previous.Matches(metadataBlocks), previous.AssemblyContexts, ImmutableDictionary(Of MetadataContextId, VisualBasicMetadataContext).Empty)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
103symbolToDeclarationAnnotationMap As ImmutableDictionary(Of ISymbol, SyntaxAnnotation), cancellationToken As CancellationToken) As Task(Of Solution)
Structure\VisualBasicBlockStructureProvider.vb (2)
13Public Shared Function CreateDefaultNodeStructureProviderMap() As ImmutableDictionary(Of Type, ImmutableArray(Of AbstractSyntaxStructureProvider)) 60Public Shared Function CreateDefaultTriviaStructureProviderMap() As ImmutableDictionary(Of Integer, ImmutableArray(Of AbstractSyntaxStructureProvider))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (4)
Syntax\SyntaxTreeTests.vb (4)
49Assert.NotSame(ImmutableDictionary(Of String, ReportDiagnostic).Empty, tree.DiagnosticOptions) 56diagnosticOptions:=ImmutableDictionary(Of String, ReportDiagnostic).Empty) 59Assert.Same(ImmutableDictionary(Of String, ReportDiagnostic).Empty, tree.DiagnosticOptions) 90Dim newTree = tree.WithDiagnosticOptions(ImmutableDictionary(Of String, ReportDiagnostic).Empty)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
ParserTestUtilities.vb (2)
536Public Overrides ReadOnly Property DiagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) 554Public Overrides Function WithDiagnosticOptions(options As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
LanguageServices\FixAllSpanMappingService\VisualBasicFixAllSpanMappingService.vb (2)
22Protected Overrides Function GetFixAllSpansIfWithinGlobalStatementAsync(document As Document, diagnosticSpan As TextSpan, cancellationToken As CancellationToken) As Task(Of ImmutableDictionary(Of Document, ImmutableArray(Of TextSpan))) 24Return Task.FromResult(ImmutableDictionary(Of Document, ImmutableArray(Of TextSpan)).Empty)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
46Private ReadOnly _renameLocations As ImmutableDictionary(Of TextSpan, RenameLocation) 81Private ReadOnly _stringAndCommentTextSpans As ImmutableDictionary(Of TextSpan, ImmutableSortedSet(Of TextSpan))
Microsoft.CodeAnalysis.Workspaces (386)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (4)
80var documentToDiagnostics = await DetermineDiagnosticsAsync(fixAllContext, progressTracker).ConfigureAwait(false); 86private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> DetermineDiagnosticsAsync(FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker) 90var documentToDiagnostics = await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false); 110ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentToDiagnostics)
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
81var documentToDiagnostics = await FixAllContextHelper.GetDocumentDiagnosticsToFixAsync(fixAllContext).ConfigureAwait(false);
CodeFixes\FixAllOccurrences\FixAllContext.cs (2)
344internal Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync() 347internal Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync()
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (5)
43internal static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(FixAllContext fixAllContext) 45var result = await GetDocumentDiagnosticsToFixWorkerAsync(fixAllContext).ConfigureAwait(false); 50static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixWorkerAsync(FixAllContext fixAllContext) 67internal static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync( 109return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty;
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (6)
21public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 40return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 53var documentsAndSpans = await spanMappingService.GetFixAllSpansAsync(document, 102return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 108static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetSpanDiagnosticsAsync( 126private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(
CodeFixes\FixAllOccurrences\FixAllState.cs (2)
64ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 86ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (6)
21public ImmutableDictionary<Document, ImmutableArray<Diagnostic>> DocumentDiagnosticsMap { get; } 22public ImmutableDictionary<Project, ImmutableArray<Diagnostic>> ProjectDiagnosticsMap { get; } 24public FixMultipleDiagnosticProvider(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsMap) 27ProjectDiagnosticsMap = ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 30public FixMultipleDiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsMap) 33DocumentDiagnosticsMap = ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty;
CodeFixesAndRefactorings\FixAllLogger.cs (2)
155public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap) 165public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap)
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (1)
90var documentsAndSpansToFix = await fixAllContext.GetFixAllSpansAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\FixAllOccurences\FixAllContext.cs (1)
94public Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetFixAllSpansAsync(CancellationToken cancellationToken)
CodeRefactorings\FixAllOccurences\FixAllState.cs (4)
90internal async Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetFixAllSpansAsync(CancellationToken cancellationToken) 99return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty; 101var spansByDocument = await spanMappingService.GetFixAllSpansAsync( 120return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty;
Diagnostics\AbstractDiagnosticPropertiesService.cs (2)
13public ImmutableDictionary<string, string> GetAdditionalProperties(Diagnostic diagnostic) 18private static ImmutableDictionary<string, string> GetAdditionalProperties(
Diagnostics\AnalysisResultPair.cs (29)
17private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSyntaxDiagnostics; 18private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSemanticDiagnostics; 19private ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedAdditionalFileDiagnostics; 20private ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? _lazyMergedCompilationDiagnostics; 21private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>? _lazyMergedAnalyzerTelemetryInfo; 41public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSyntaxDiagnostics 66public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSemanticDiagnostics 91public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedAdditionalFileDiagnostics 116public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> MergedCompilationDiagnostics 141public ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> MergedAnalyzerTelemetryInfo 174private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergeDiagnostics<TKey>( 175ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> first, 176ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> second) 182if (!localSyntaxDiagnostics.TryGetValue(tree, out var projectSyntaxDiagnostics)) 194private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> MergeDiagnostics( 195ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> first, 196ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> second) 213private static ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> MergeTelemetry( 214ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> first, 215ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> second)
Diagnostics\DiagnosticAnalysisResult.cs (17)
29private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _syntaxLocals; 34private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _semanticLocals; 39private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> _nonLocals; 48ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocals, 49ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocals, 50ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocals, 70syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 71semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 72nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 78ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocalMap, 79ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocalMap, 80ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocalMap, 105private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? GetMap(AnalysisKind kind) 134var map = GetMap(kind); 151semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 152nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 156private static void VerifyDocumentMap(Project project, ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> map)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (5)
29public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SyntaxLocals => Convert(_lazySyntaxLocals); 30public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SemanticLocals => Convert(_lazySemanticLocals); 31public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> NonLocals => Convert(_lazyNonLocals); 189private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Convert(Dictionary<DocumentId, List<DiagnosticData>>? map) 192? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty
Diagnostics\DiagnosticAnalysisResultMap.cs (8)
17ImmutableDictionary<TKey, TValue> analysisResult, 18ImmutableDictionary<TKey, AnalyzerTelemetryInfo> telemetryInfo) 29ImmutableDictionary<TKey, TValue>.Empty, 30ImmutableDictionary<TKey, AnalyzerTelemetryInfo>.Empty); 32public readonly ImmutableDictionary<TKey, TValue> AnalysisResult; 33public readonly ImmutableDictionary<TKey, AnalyzerTelemetryInfo> TelemetryInfo; 36ImmutableDictionary<TKey, TValue> analysisResult, 37ImmutableDictionary<TKey, AnalyzerTelemetryInfo> telemetryInfo)
Diagnostics\DiagnosticData.cs (7)
30ImmutableDictionary<string, string?> properties, 65public readonly ImmutableDictionary<string, string?> Properties = properties; 97internal static ImmutableDictionary<string, string> PropertiesForBuildDiagnostic { get; } 98= ImmutableDictionary<string, string>.Empty.Add(WellKnownDiagnosticPropertyNames.Origin, WellKnownDiagnosticTags.Build); 211var additionalProperties = GetAdditionalProperties(document, diagnostic); 237ImmutableDictionary<string, string?>? additionalProperties) 259private static ImmutableDictionary<string, string?>? GetAdditionalProperties(TextDocument document, Diagnostic diagnostic)
Diagnostics\Extensions.cs (3)
106public static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>> ToResultBuilderMapAsync( 151ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? diagnosticsByAnalyzerMap; 242ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnosticsByAnalyzer,
Diagnostics\HostDiagnosticAnalyzers.cs (32)
23private readonly ImmutableDictionary<object, AnalyzerReference> _hostAnalyzerReferencesMap; 31private readonly ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _hostDiagnosticAnalyzersPerLanguageMap; 40private readonly Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _lazyHostDiagnosticAnalyzersPerReferenceMap; 45private ImmutableDictionary<string, DiagnosticAnalyzer> _compilerDiagnosticAnalyzerMap; 55private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, StrongBox<ImmutableDictionary<string, SkippedHostAnalyzersInfo>>> _skippedHostAnalyzers = new(); 61_hostDiagnosticAnalyzersPerLanguageMap = new ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(concurrencyLevel: 2, capacity: 2); 62_lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap), isThreadSafe: true); 64_compilerDiagnosticAnalyzerMap = ImmutableDictionary<string, DiagnosticAnalyzer>.Empty; 75public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> GetOrCreateHostDiagnosticAnalyzersPerReference(string language) 78public ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>> GetDiagnosticDescriptorsPerReference(DiagnosticAnalyzerInfoCache infoCache) 85public ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>> GetDiagnosticDescriptorsPerReference(DiagnosticAnalyzerInfoCache infoCache, Project project) 87var descriptorPerReference = CreateDiagnosticDescriptorsPerReference(infoCache, CreateDiagnosticAnalyzersPerReference(project)); 88var map = _hostAnalyzerReferencesMap.AddRange(CreateProjectAnalyzerReferencesMap(project.AnalyzerReferences)); 92private static ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>> ConvertReferenceIdentityToName( 93ImmutableDictionary<object, ImmutableArray<DiagnosticDescriptor>> descriptorsPerReference, 94ImmutableDictionary<object, AnalyzerReference> map) 124public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReference(Project project) 126var hostAnalyzerReferences = GetOrCreateHostDiagnosticAnalyzersPerReference(project.Language); 127var projectAnalyzerReferences = CreateProjectDiagnosticAnalyzersPerReference(project.AnalyzerReferences, project.Language); 136public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(ProjectState project) 139public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences, string language) 156private ImmutableDictionary<object, AnalyzerReference> CreateProjectAnalyzerReferencesMap(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences) 159private static ImmutableDictionary<object, ImmutableArray<DiagnosticDescriptor>> CreateDiagnosticDescriptorsPerReference( 161ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersMap) 180private ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateHostDiagnosticAnalyzersAndBuildMap(string language) 219private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReferenceMap( 260private static ImmutableDictionary<object, AnalyzerReference> CreateAnalyzerReferencesMap(IEnumerable<AnalyzerReference> analyzerReferences) 279private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MergeDiagnosticAnalyzerMap( 280ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map1, 281ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map2) 283var current = map1; 310box.Value ??= ImmutableDictionary<string, SkippedHostAnalyzersInfo>.Empty;
Diagnostics\IDiagnosticPropertiesService.cs (1)
12ImmutableDictionary<string, string> GetAdditionalProperties(Diagnostic diagnostic);
Diagnostics\SkippedHostAnalyzersInfo.cs (4)
23ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>>.Empty); 37public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> FilteredDiagnosticIdsForAnalyzers { get; } 41ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> filteredDiagnosticIdsForAnalyzers) 110var filteredDiagnosticIdsForAnalyzers = partiallySkippedHostAnalyzersBuilder.ToImmutable();
Editing\SymbolEditor.cs (1)
129private ImmutableDictionary<string, ImmutableArray<ProjectId>> _assemblyNameToProjectIdMap;
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (1)
40public ImmutableDictionary<string, ImmutableArray<int>> ReceiverTypeNameToExtensionMethodMap
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.ExtensionMethodInfo.cs (2)
15private readonly struct ExtensionMethodInfo(ImmutableDictionary<string, ImmutableArray<int>> receiverTypeNameToExtensionMethodMap) 43public readonly ImmutableDictionary<string, ImmutableArray<int>> ReceiverTypeNameToExtensionMethodMap { get; } = receiverTypeNameToExtensionMethodMap;
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (3)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync(
LanguageServices\FixAllSpanMappingService\IFixAllSpanMappingService.cs (1)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync(
Log\FunctionIdExtensions.cs (1)
13private static readonly Lazy<ImmutableDictionary<FunctionId, string>> s_functionIdsToString = new(
Options\DocumentOptionSet.cs (3)
27private ImmutableDictionary<OptionKey, object?> _values; 30: this(configOptions, underlyingOptions, language, ImmutableDictionary<OptionKey, object?>.Empty) 34private DocumentOptionSet(StructuredAnalyzerConfigOptions? configOptions, OptionSet underlyingOptions, string language, ImmutableDictionary<OptionKey, object?> values)
Options\GlobalOptionService.cs (4)
29private ImmutableDictionary<OptionKey2, object?> _currentValues = ImmutableDictionary.Create<OptionKey2, object?>(); 91var currentValues = _currentValues; 119private static object? GetOption_NoLock(ref ImmutableDictionary<OptionKey2, object?> currentValues, OptionKey2 optionKey, ImmutableArray<IOptionPersister> persisters) 155var currentValues = _currentValues;
Options\LegacyWorkspaceOptionService.cs (1)
37private ImmutableDictionary<OptionKey, object?> _currentExternallyDefinedOptionValues = ImmutableDictionary.Create<OptionKey, object?>();
Options\SolutionOptionSet.cs (3)
24private ImmutableDictionary<OptionKey, object?> _values; 33ImmutableDictionary<OptionKey, object?> values, 42: this(globalOptions, values: ImmutableDictionary<OptionKey, object?>.Empty, changedOptionKeys: [])
Remote\RemoteServiceCallbackDispatchers.cs (1)
29private readonly ImmutableDictionary<Type, Lazy<IRemoteServiceCallbackDispatcher, ExportMetadata>> _callbackDispatchers = dispatchers.ToImmutableDictionary(d => d.Metadata.ServiceInterface);
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
795var allTextSpansInSingleSourceTree = renameLocations 800var stringAndCommentTextSpansInSingleSourceTree = renameLocations
Rename\ConflictEngine\MutableConflictResolution.cs (3)
151var documentToModifiedSpansMap = renamedSpansTracker.GetDocumentToModifiedSpansMap(); 152var documentToComplexifiedSpansMap = renamedSpansTracker.GetDocumentToComplexifiedSpansMap(); 153var documentToRelatedLocationsMap = this.RelatedLocations.GroupBy(loc => loc.DocumentId).ToImmutableDictionary(
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
224public ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> GetDocumentToModifiedSpansMap() 234public ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> GetDocumentToComplexifiedSpansMap()
Rename\ConflictResolution.cs (10)
49private readonly ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> _documentToModifiedSpansMap; 50private readonly ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> _documentToComplexifiedSpansMap; 51private readonly ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> _documentToRelatedLocationsMap; 65_documentToModifiedSpansMap = ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>>.Empty; 66_documentToComplexifiedSpansMap = ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>>.Empty; 67_documentToRelatedLocationsMap = ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>>.Empty; 76ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> documentToModifiedSpansMap, 77ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> documentToComplexifiedSpansMap, 78ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> documentToRelatedLocationsMap) 103public ImmutableDictionary<TextSpan, TextSpan> GetModifiedSpanMap(DocumentId documentId)
Rename\IRemoteRenamerService.cs (6)
211ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> documentToModifiedSpansMap, 212ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> documentToComplexifiedSpansMap, 213ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> documentToRelatedLocationsMap) 231public readonly ImmutableDictionary<DocumentId, ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)>> DocumentToModifiedSpansMap = documentToModifiedSpansMap; 234public readonly ImmutableDictionary<DocumentId, ImmutableArray<ComplexifiedSpan>> DocumentToComplexifiedSpansMap = documentToComplexifiedSpansMap; 237public readonly ImmutableDictionary<DocumentId, ImmutableArray<RelatedLocation>> DocumentToRelatedLocationsMap = documentToRelatedLocationsMap;
Rename\RenameRewriterParameters.cs (4)
21ImmutableDictionary<TextSpan, RenameLocation> renameLocations, 22ImmutableDictionary<TextSpan, ImmutableSortedSet<TextSpan>?> stringAndCommentTextSpans, 42internal readonly ImmutableDictionary<TextSpan, RenameLocation> RenameLocations = renameLocations; 47internal readonly ImmutableDictionary<TextSpan, ImmutableSortedSet<TextSpan>?> StringAndCommentTextSpans = stringAndCommentTextSpans;
Serialization\SerializationExtensions.cs (1)
32ImmutableDictionary<string, StructuredAnalyzerConfigOptions> => WellKnownSynchronizationKind.FallbackAnalyzerOptions,
Serialization\SerializerService.cs (4)
152Write(writer, (ImmutableDictionary<string, StructuredAnalyzerConfigOptions>)value); 163private static void Write(ObjectWriter writer, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> optionsByLanguage) 197private static ImmutableDictionary<string, StructuredAnalyzerConfigOptions> ReadFallbackAnalyzerOptions(ObjectReader reader) 202return ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty;
Shared\Extensions\ILanguageMetadataExtensions.cs (2)
29public static ImmutableDictionary<string, ImmutableArray<Lazy<TInterface, TMetadata>>> ToPerLanguageMap<TInterface, TMetadata>(this IEnumerable<Lazy<TInterface, TMetadata>> services) 44public static ImmutableDictionary<string, ImmutableArray<Lazy<TInterface, TMetadata>>> ToPerLanguageMapWithMultipleLanguages<TInterface, TMetadata>(this IEnumerable<Lazy<TInterface, TMetadata>> services)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Workspace\Host\Metadata\MetadataReferenceCache.cs (2)
20private ImmutableDictionary<string, ReferenceSet> _referenceSets 21= ImmutableDictionary<string, ReferenceSet>.Empty;
Workspace\ProjectSystem\IRuleSetFile.cs (1)
16ImmutableDictionary<string, ReportDiagnostic> GetSpecificDiagnosticOptions();
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (4)
61private ImmutableDictionary<ProjectId, string?> _projectToMaxSupportedLangVersionMap = ImmutableDictionary<ProjectId, string?>.Empty; 64private ImmutableDictionary<ProjectId, string> _projectToDependencyNodeTargetIdentifier = ImmutableDictionary<ProjectId, string>.Empty;
Workspace\ProjectSystem\ProjectSystemProjectFactory.ProjectUpdateState.cs (8)
53ImmutableDictionary<string, ImmutableArray<ProjectId>> ProjectsByOutputPath, 54ImmutableDictionary<ProjectId, ProjectReferenceInformation> ProjectReferenceInfos, 61ImmutableDictionary<string, ImmutableArray<ProjectId>>.Empty.WithComparers(StringComparer.OrdinalIgnoreCase), 62ImmutableDictionary<ProjectId, ProjectReferenceInformation>.Empty, [], [], [], []); 79static ImmutableDictionary<string, ImmutableArray<ProjectId>> AddProject(string path, ProjectId projectId, ImmutableDictionary<string, ImmutableArray<ProjectId>> map) 99static ImmutableDictionary<string, ImmutableArray<ProjectId>> RemoveProject(string path, ProjectId projectId, ImmutableDictionary<string, ImmutableArray<ProjectId>> map)
Workspace\Solution\AnalyzerConfigData.cs (1)
24public readonly ImmutableDictionary<string, ReportDiagnostic> TreeOptions;
Workspace\Solution\ProjectDependencyGraph.cs (24)
35private readonly ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _referencesMap; 45private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? _lazyReverseReferencesMap; 56private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _transitiveReferencesMap; 57private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> _reverseTransitiveReferencesMap; 69ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 71ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 72ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 78ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 83transitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 84reverseTransitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 93ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap, 94ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap, 95ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> transitiveReferencesMap, 96ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> reverseTransitiveReferencesMap, 117private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> RemoveItemsWithEmptyValues( 118ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> map) 120ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Builder? builder = null; 160var referencesMap = referencedProjectIds.IsEmpty ? 214private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeReverseReferencesMap() 274var currentMap = _transitiveReferencesMap; 326var currentMap = _reverseTransitiveReferencesMap; 490ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 510ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> forwardReferencesMap, 511ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (12)
35var newReferencesMap = ComputeNewReferencesMapForAdditionalProjectReferences(_referencesMap, projectId, referencedProjectIds); 37var newReverseReferencesMap = ComputeNewReverseReferencesMapForAdditionalProjectReferences(_lazyReverseReferencesMap, projectId, referencedProjectIds); 39var newTransitiveReferencesMap = ComputeNewTransitiveReferencesMapForAdditionalProjectReferences(_transitiveReferencesMap, projectId, referencedProjectIds); 41var newReverseTransitiveReferencesMap = ComputeNewReverseTransitiveReferencesMapForAdditionalProjectReferences(_reverseTransitiveReferencesMap, projectId, referencedProjectIds); 58private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForAdditionalProjectReferences( 59ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReferencesMap, 78private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForAdditionalProjectReferences( 79ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 99private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForAdditionalProjectReferences( 100ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 155private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForAdditionalProjectReferences( 156ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (12)
25var referencesMap = ComputeNewReferencesMapForRemovedAllProjectReferences(_referencesMap, projectId); 26var reverseReferencesMap = ComputeNewReverseReferencesMapForRemovedAllProjectReferences(_lazyReverseReferencesMap, projectId, referencedProjectIds); 27var transitiveReferencesMap = ComputeNewTransitiveReferencesMapForRemovedAllProjectReferences(_transitiveReferencesMap, projectId, referencedProjectIds); 28var reverseTransitiveReferencesMap = ComputeNewReverseTransitiveReferencesMapForRemovedAllProjectReferences(_reverseTransitiveReferencesMap, projectId); 40private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedAllProjectReferences( 41ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 58private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedAllProjectReferences( 59ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 77private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedAllProjectReferences( 78ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 104private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedAllProjectReferences( 105ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\ProjectDependencyGraph_RemoveProject.cs (14)
23var referencesMap = ComputeNewReferencesMapForRemovedProject( 30var reverseReferencesMap = ComputeNewReverseReferencesMapForRemovedProject( 34var transitiveReferencesMap = ComputeNewTransitiveReferencesMapForRemovedProject(_transitiveReferencesMap, removedProjectIds); 35var reverseTransitiveReferencesMap = ComputeNewReverseTransitiveReferencesMapForRemovedProject(_reverseTransitiveReferencesMap, removedProjectIds); 55private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProject( 56ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 57ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 99private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProject( 100ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 101ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 133private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProject( 134ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 167private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProject( 168ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (12)
23var referencesMap = ComputeNewReferencesMapForRemovedProjectReference(_referencesMap, projectId, referencedProjectId); 24var reverseReferencesMap = ComputeNewReverseReferencesMapForRemovedProjectReference(_lazyReverseReferencesMap, projectId, referencedProjectId); 25var transitiveReferencesMap = ComputeNewTransitiveReferencesMapForRemovedProjectReference(_transitiveReferencesMap, projectId, referencedProjectId); 26var reverseTransitiveReferencesMap = ComputeNewReverseTransitiveReferencesMapForRemovedProjectReference(_reverseTransitiveReferencesMap, projectId, referencedProjectId); 38private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProjectReference( 39ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 55private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProjectReference( 56ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 68private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProjectReference( 69ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 95private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProjectReference( 96ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\Solution.cs (3)
63ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 520internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options) 1720internal ImmutableDictionary<string, StructuredAnalyzerConfigOptions> FallbackAnalyzerOptions => SolutionState.FallbackAnalyzerOptions;
Workspace\Solution\SolutionCompilationState.cs (2)
958/// <inheritdoc cref="SolutionState.WithFallbackAnalyzerOptions(ImmutableDictionary{string, StructuredAnalyzerConfigOptions})"/> 959public SolutionCompilationState WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
Workspace\Solution\SolutionInfo.cs (4)
50internal ImmutableDictionary<string, StructuredAnalyzerConfigOptions> FallbackAnalyzerOptions { get; } 56ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 87=> Create(id, version, filePath, projects, analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty); 98ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
Workspace\Solution\SolutionState.cs (14)
50public ImmutableDictionary<string, StructuredAnalyzerConfigOptions> FallbackAnalyzerOptions { get; } = ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty; 56internal ImmutableDictionary<string, int> ProjectCountByLanguage { get; } = ImmutableDictionary<string, int>.Empty; 74ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions, 75ImmutableDictionary<string, int> projectCountByLanguage, 111ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 121projectCountByLanguage: ImmutableDictionary<string, int>.Empty, 177ImmutableDictionary<string, int>? projectCountByLanguage = null, 182ImmutableDictionary<string, StructuredAnalyzerConfigOptions>? fallbackAnalyzerOptions = null, 509private static ImmutableDictionary<string, int> AddLanguageCounts(ImmutableDictionary<string, int> projectCountByLanguage, in TemporaryArray<(string language, int count)> languageCountDeltas) 929public SolutionState WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options) 1217var map = sortedNewProjectStates.Select(state => KeyValuePair.Create(
Workspace\Workspace.cs (4)
95fallbackAnalyzerOptions: ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty); 136private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 421var newFallbackOptions = newSolution.FallbackAnalyzerOptions; 1048internal void OnSolutionFallbackAnalyzerOptionsChanged(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
Microsoft.CodeAnalysis.Workspaces.Desktop (2)
Workspace\Host\Mef\MefV1HostServices.cs (2)
33private ImmutableDictionary<ExportKey, IEnumerable> _exportsMap 34= ImmutableDictionary<ExportKey, IEnumerable>.Empty;
Microsoft.CodeAnalysis.Workspaces.MSBuild (14)
MSBuild\BuildHostProcessManager.cs (3)
25private readonly ImmutableDictionary<string, string> _globalMSBuildProperties; 36public BuildHostProcessManager(ImmutableDictionary<string, string>? globalMSBuildProperties = null, IBinLogPathProvider? binaryLogPathProvider = null, ILoggerFactory? loggerFactory = null) 38_globalMSBuildProperties = globalMSBuildProperties ?? ImmutableDictionary<string, string>.Empty;
MSBuild\MSBuildProjectLoader.cs (3)
37ImmutableDictionary<string, string>? properties) 59public MSBuildProjectLoader(Workspace workspace, ImmutableDictionary<string, string>? properties = null) 79public ImmutableDictionary<string, string> Properties { get; private set; }
MSBuild\MSBuildProjectLoader.Worker.cs (2)
42private readonly ImmutableDictionary<string, string> _globalProperties; 81ImmutableDictionary<string, string> globalProperties,
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (2)
50private readonly ImmutableDictionary<string, HashSet<int>> _pathToIndicesMap; 67private static ImmutableDictionary<string, HashSet<int>> CreatePathToIndexMap(ImmutableArray<MetadataReference> metadataReferences)
MSBuild\MSBuildWorkspace.cs (4)
39ImmutableDictionary<string, string> properties) 53return Create(ImmutableDictionary<string, string>.Empty); 72return Create(ImmutableDictionary<string, string>.Empty, hostServices); 102public ImmutableDictionary<string, string> Properties => _loader.Properties;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (30)
Build\ProjectBuildManager.cs (7)
28private static readonly ImmutableDictionary<string, string> s_defaultGlobalProperties = new Dictionary<string, string>() 60private readonly ImmutableDictionary<string, string> _additionalGlobalProperties; 73public ProjectBuildManager(ImmutableDictionary<string, string> additionalGlobalProperties, ILogger? msbuildLogger = null) 75_additionalGlobalProperties = additionalGlobalProperties ?? ImmutableDictionary<string, string>.Empty; 79private ImmutableDictionary<string, string> AllGlobalProperties 224globalProperties ??= ImmutableDictionary<string, string>.Empty; 225var allProperties = s_defaultGlobalProperties.RemoveRange(globalProperties.Keys).AddRange(globalProperties);
BuildHost.cs (2)
21private readonly ImmutableDictionary<string, string> _globalMSBuildProperties; 27public BuildHost(BuildHostLogger logger, ImmutableDictionary<string, string> globalMSBuildProperties, string? binaryLogPath, RpcServer server)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (1)
157private static readonly ImmutableDictionary<string, string> s_debugTypeValues = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (3)
17private readonly ImmutableDictionary<T, uint> _map; 20private ImmutableSetWithInsertionOrder(ImmutableDictionary<T, uint> map, uint nextElementValue) 49var modifiedMap = _map.Remove(value);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
BuildHostProcessManagerTests.cs (1)
131var globalMSBuildProperties = new Dictionary<string, string>
FileSet.cs (1)
21_fileMap = fileMap ?? ImmutableDictionary<string, object>.Empty;
NetCoreTests.cs (1)
111await using var buildHostProcessManager = new BuildHostProcessManager(ImmutableDictionary<string, string>.Empty);
VisualStudioMSBuildWorkspaceTests.cs (1)
3105await using var buildHostProcessManager = new BuildHostProcessManager(ImmutableDictionary<string, string>.Empty);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (10)
Fakes\TestOptionSet.cs (3)
14public static new readonly TestOptionSet Empty = new(ImmutableDictionary<OptionKey, object?>.Empty); 16private readonly ImmutableDictionary<OptionKey, object?> _values; 18public TestOptionSet(ImmutableDictionary<OptionKey, object?> values)
Options\OptionsTestInfo.cs (3)
16private static Tuple<string, ImmutableDictionary<string, OptionsTestInfo>>? s_cachedResult; 18public static ImmutableDictionary<string, OptionsTestInfo> CollectOptions(string directory) 82var result = resultBuilder.ToImmutable();
Remote\TestSerializerService.cs (2)
33private static readonly ImmutableDictionary<MetadataReference, string?> s_wellKnownReferenceNames = ImmutableDictionary.Create<MetadataReference, string?>(ReferenceEqualityComparer.Instance) 39private static readonly ImmutableDictionary<string, MetadataReference> s_wellKnownReferences = ImmutableDictionary.Create<string, MetadataReference>()
Workspaces\TestWorkspace_XmlConsumption.cs (2)
635ImmutableDictionary<string, ImmutableArray<TextSpan>> spans; 661spans = ImmutableDictionary<string, ImmutableArray<TextSpan>>.Empty;
Microsoft.CodeAnalysis.Workspaces.UnitTests (17)
Formatter\FormatterTests.cs (1)
85var options = passExplicitOptions ? new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty.
Options\DocumentOptionSetTests.cs (6)
21var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty.Add( 51var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty.Add( 73var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty); 90var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty); 122var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty 152var underlyingSet = new TestOptionSet(ImmutableDictionary<OptionKey, object?>.Empty);
SolutionTests\SolutionTests.cs (4)
2287var solution2 = solution.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2288.Add(LanguageNames.CSharp, StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty 2294var solution3 = solution2.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2295.Add(LanguageNames.CSharp, StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty
UtilityTest\ImmutableDictionaryExtensionsTests.cs (6)
16var empty = ImmutableDictionary<int, int>.Empty; 32var emptyOrdinal = ImmutableDictionary<string, int>.Empty.WithComparers(keyComparer: StringComparer.Ordinal); 33var emptyIgnoreCase = ImmutableDictionary<string, int>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Tasks.Feed (6)
src\model\SetupTargetFeedConfigV3.cs (3)
91public ImmutableDictionary<string, string> FeedOverrides { get; set; } 93public ImmutableDictionary<string, string> FeedSasUris { get; set; } 95public ImmutableDictionary<string, string> FeedKeys { get; set; }
src\model\SetupTargetFeedConfigV4.cs (3)
90public ImmutableDictionary<string, string> FeedOverrides { get; set; } 92public ImmutableDictionary<string, string> FeedSasUris { get; set; } 94public ImmutableDictionary<string, string> FeedKeys { get; set; }
Microsoft.DotNet.SignTool (4)
src\BatchSignInput.cs (2)
25internal ImmutableDictionary<SignedFileContentKey, ZipData> ZipDataMap; 33internal BatchSignInput(ImmutableArray<FileSignInfo> filesToSign, ImmutableDictionary<SignedFileContentKey, ZipData> zipDataMap, ImmutableArray<KeyValuePair<string, string>> filesToCopy)
src\ZipData.cs (2)
39internal ImmutableDictionary<string, ZipPart> NestedParts { get; } 41internal ZipData(FileSignInfo fileSignInfo, ImmutableDictionary<string, ZipPart> nestedBinaryParts)
Microsoft.Interop.ComInterfaceGenerator (34)
Analyzers\AddGeneratedComClassFixer.cs (7)
43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 48protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 57protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic) 59return ImmutableDictionary<string, Option>.Empty; 62protected override ImmutableDictionary<string, Option> CombineOptions(ImmutableDictionary<string, Option> fixAllOptions, ImmutableDictionary<string, Option> diagnosticOptions) => fixAllOptions;
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
136ImmutableDictionary<string, string>.Builder properties = ImmutableDictionary.CreateBuilder<string, string>();
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (7)
28protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 43protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic) 58protected override ImmutableDictionary<string, Option> CombineOptions(ImmutableDictionary<string, Option> fixAllOptions, ImmutableDictionary<string, Option> diagnosticOptions) 60ImmutableDictionary<string, Option> combinedOptions = fixAllOptions;
ComInterfaceGenerator.cs (1)
370ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddMarshalAsAttribute, "Error"),
GeneratedComInterfaceAttributeData.cs (1)
65var args = attr.NamedArguments.ToImmutableDictionary();
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (16)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 35protected abstract string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions); 59public static ImmutableDictionary<string, Option> ParseOptionsFromEquivalenceKey(string equivalenceKey) 61ImmutableDictionary<string, Option>.Builder options = ImmutableDictionary.CreateBuilder<string, Option>(); 86public static string CreateEquivalenceKeyFromOptions(string baseEquivalenceKey, ImmutableDictionary<string, Option> options) 97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 99protected abstract ImmutableDictionary<string, Option> CombineOptions(ImmutableDictionary<string, Option> fixAllOptions, ImmutableDictionary<string, Option> diagnosticOptions); 101private ImmutableDictionary<string, Option> GetOptionsForIndividualFix(ImmutableDictionary<string, Option> fixAllOptions, Diagnostic diagnostic) 130var options = ParseOptionsFromDiagnostic(diagnostic); 135var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true)); 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 171var options = Option.ParseOptionsFromEquivalenceKey(fixAllContext.CodeActionEquivalenceKey);
VtableIndexStubGenerator.cs (1)
138var namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments);
Microsoft.Interop.LibraryImportGenerator (32)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
83ImmutableDictionary<string, string>.Builder properties = ImmutableDictionary.CreateBuilder<string, string>();
Analyzers\ConvertToLibraryImportFixer.cs (8)
37protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 56protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic) 71protected override ImmutableDictionary<string, Option> CombineOptions(ImmutableDictionary<string, Option> fixAllOptions, ImmutableDictionary<string, Option> diagnosticOptions) 76protected override IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 83var selectedOptions = options.Remove(CharSetOption); 129protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (2)
30public static ImmutableDictionary<string, string> CreateDiagnosticPropertiesForMissingMembersDiagnostic(MarshalMode mode, params string[] missingMemberNames) 33public static ImmutableDictionary<string, string> CreateDiagnosticPropertiesForMissingMembersDiagnostic(MarshalMode mode, IEnumerable<string> missingMemberNames)
Analyzers\DiagnosticReporter.cs (4)
12private readonly Action<DiagnosticDescriptor, ImmutableDictionary<string, string>, object[]> _diagnosticFactory; 14public DiagnosticReporter(Action<DiagnosticDescriptor, ImmutableDictionary<string, string>, object[]> createAndReportDiagnostic) 21public void CreateAndReportDiagnostic(DiagnosticDescriptor descriptor, params object[] messageArgs) => _diagnosticFactory(descriptor, ImmutableDictionary<string, string>.Empty, messageArgs); 23public void CreateAndReportDiagnostic(DiagnosticDescriptor descriptor, ImmutableDictionary<string, string> properties, params object[] messageArgs) => _diagnosticFactory(descriptor, properties, messageArgs);
LibraryImportGenerator.cs (1)
200ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (16)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 35protected abstract string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions); 59public static ImmutableDictionary<string, Option> ParseOptionsFromEquivalenceKey(string equivalenceKey) 61ImmutableDictionary<string, Option>.Builder options = ImmutableDictionary.CreateBuilder<string, Option>(); 86public static string CreateEquivalenceKeyFromOptions(string baseEquivalenceKey, ImmutableDictionary<string, Option> options) 97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 99protected abstract ImmutableDictionary<string, Option> CombineOptions(ImmutableDictionary<string, Option> fixAllOptions, ImmutableDictionary<string, Option> diagnosticOptions); 101private ImmutableDictionary<string, Option> GetOptionsForIndividualFix(ImmutableDictionary<string, Option> fixAllOptions, Diagnostic diagnostic) 130var options = ParseOptionsFromDiagnostic(diagnostic); 135var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true)); 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 171var options = Option.ParseOptionsFromEquivalenceKey(fixAllContext.CodeActionEquivalenceKey);
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
142ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments);
Microsoft.Interop.SourceGeneration (29)
DiagnosticExtensions.cs (8)
23ImmutableDictionary<string, string> properties, 45ImmutableDictionary<string, string> properties, 67ImmutableDictionary<string, string> properties, 106ImmutableDictionary<string, string> properties, 127ImmutableDictionary<string, string> properties, 149ImmutableDictionary<string, string> properties, 171ImmutableDictionary<string, string> properties, 210ImmutableDictionary<string, string> properties,
DiagnosticInfo.cs (2)
38public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, ImmutableDictionary<string, string>? properties, params object?[] messageArgs) 50public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, IEnumerable<Location>? additionalLocations, ImmutableDictionary<string, string>? properties, params object?[] messageArgs)
InteropAttributeData.cs (1)
55public static T WithValuesFromNamedArguments<T>(this T t, ImmutableDictionary<string, TypedConstant> namedArguments) where T : InteropAttributeCompilationData
ManualTypeMarshallingHelper.cs (1)
25ImmutableDictionary<MarshalMode, CustomTypeMarshallerData> Modes)
MarshalAsParser.cs (1)
135ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attributeData.NamedArguments);
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (2)
24private static readonly ImmutableDictionary<string, string> AddDisableRuntimeMarshallingAttributeProperties = 25ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute);
Marshalling\BlittableMarshallerResolver.cs (2)
18private static readonly ImmutableDictionary<string, string> AddDisableRuntimeMarshallingAttributeProperties = 19ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute);
Marshalling\GeneratorDiagnostic.cs (2)
22public ImmutableDictionary<string, string> DiagnosticProperties { get; init; } = ImmutableDictionary<string, string>.Empty;
Marshalling\NoMarshallingInfoErrorResolver.cs (3)
33private NoMarshallingInfoErrorResolver(ImmutableDictionary<ManagedTypeInfo, string> customTypeToErrorMessageMap) 38public ImmutableDictionary<ManagedTypeInfo, string> CustomTypeToErrorMessageMap { get; } 40private static ImmutableDictionary<ManagedTypeInfo, string> DefaultTypeToErrorMessageMap(string stringMarshallingAttribute)
MarshallingAttributeInfo.cs (1)
179new CustomTypeMarshallers(ImmutableDictionary<MarshalMode, CustomTypeMarshallerData>.Empty.Add(
MarshalUsingAttributeParser.cs (1)
66ImmutableDictionary<string, TypedConstant> namedArgs = ImmutableDictionary.CreateRange(attributeData.NamedArguments);
SafeHandleMarshallingInfoProvider.cs (1)
79Modes = ImmutableDictionary<MarshalMode, CustomTypeMarshallerData>.Empty
UseSiteAttributeProvider.cs (2)
16private readonly ImmutableDictionary<int, UseSiteAttributeData> _useSiteAttributesByIndirectionDepth; 36ImmutableDictionary<int, UseSiteAttributeData>.Builder useSiteAttributesByIndirectionDepth = ImmutableDictionary.CreateBuilder<int, UseSiteAttributeData>();
ValueEqualityImmutableDictionary.cs (2)
11public record struct ValueEqualityImmutableDictionary<T, U>(ImmutableDictionary<T, U> Map) : IDictionary<T, U> 73public static ValueEqualityImmutableDictionary<TKey, TValue> ToValueEquals<TKey, TValue>(this ImmutableDictionary<TKey, TValue> source)
Microsoft.ML.Core (12)
Utilities\FuncMethodInfo1`1.cs (2)
26private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 31_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty;
Utilities\FuncMethodInfo1`2.cs (2)
27private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 32_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty;
Utilities\FuncMethodInfo1`3.cs (2)
28private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty;
Utilities\FuncMethodInfo2`3.cs (2)
28private ImmutableDictionary<(Type, Type), MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<(Type, Type), MethodInfo>.Empty;
Utilities\FuncMethodInfo3`2.cs (2)
27private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo; 32_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty;
Utilities\FuncMethodInfo3`3.cs (2)
28private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty;
Microsoft.ML.InternalCodeAnalyzer (2)
NameAnalyzer.cs (2)
35var props = ImmutableDictionary<string, string>.Empty
Microsoft.ML.Tests (10)
PermutationFeatureImportanceTests.cs (10)
41ImmutableDictionary<string, RegressionMetricsStatistics> pfiDict; 109ImmutableDictionary<string, RegressionMetricsStatistics> pfiDict; 183ImmutableDictionary<string, RegressionMetricsStatistics> pfiDict; 271ImmutableDictionary<string, RegressionMetricsStatistics> pfiDict; 346ImmutableDictionary<string, BinaryClassificationMetricsStatistics> pfiDict; 420ImmutableDictionary<string, BinaryClassificationMetricsStatistics> pfiDict; 528ImmutableDictionary<string, MulticlassClassificationMetricsStatistics> pfiDict; 601ImmutableDictionary<string, MulticlassClassificationMetricsStatistics> pfiDict; 679ImmutableDictionary<string, RankingMetricsStatistics> pfiDict; 748ImmutableDictionary<string, RankingMetricsStatistics> pfiDict;
Microsoft.ML.Transforms (5)
PermutationFeatureImportanceExtensions.cs (5)
127public static ImmutableDictionary<string, RegressionMetricsStatistics> 277public static ImmutableDictionary<string, BinaryClassificationMetricsStatistics> 431public static ImmutableDictionary<string, MulticlassClassificationMetricsStatistics> 593public static ImmutableDictionary<string, RankingMetricsStatistics> 651private static ImmutableDictionary<string, TResult>
Microsoft.VisualStudio.LanguageServices (77)
CodeLens\CodeLensCallbackListener.cs (1)
63public async Task<ImmutableDictionary<Guid, string>> GetProjectVersionsAsync(ImmutableArray<Guid> projectGuids, CancellationToken cancellationToken)
ColorSchemes\ColorSchemeApplier.cs (2)
31private readonly ImmutableDictionary<ColorSchemeName, ColorScheme> _colorSchemes; 36private ImmutableDictionary<ColorSchemeName, ImmutableArray<RegistryItem>>? _colorSchemeRegistryItems;
ColorSchemes\ColorSchemeApplier.Settings.cs (1)
41public static ImmutableDictionary<ColorSchemeName, ColorScheme> GetColorSchemes()
CommonControls\MemberSelectionViewModel.cs (3)
22private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>>? _symbolToDependentsMap; 23private readonly ImmutableDictionary<ISymbol, MemberSymbolViewModel> _symbolToMemberViewMap; 28ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>>? dependentsMap,
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
120ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>> map)
ExtractClass\ExtractClassViewModel.cs (1)
26ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> memberToDependentsMap,
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
68var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationToken);
MoveStaticMembers\StaticMemberSelectionViewModel.cs (3)
18private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 19private readonly ImmutableDictionary<ISymbol, SymbolViewModel<ISymbol>> _symbolToMemberViewMap; 24ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap)
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
107var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationTokenSource.Token);
Options\VisualStudioOptionPersisterProvider.cs (1)
28private readonly ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>> _readFallbacks;
Options\VisualStudioSettingsOptionPersister.cs (4)
28private readonly ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>> _readFallbacks; 34private ImmutableDictionary<string, (OptionKey2 primaryOptionKey, string primaryStorageKey)> _storageKeysToMonitorForChanges 35= ImmutableDictionary<string, (OptionKey2, string)>.Empty; 40public VisualStudioSettingsOptionPersister(Action<OptionKey2, object?> refreshOption, ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>> readFallbacks, ISettingsManager settingsManager)
Packaging\PackageInstallerService.ProjectState.cs (4)
14public static readonly ProjectState Disabled = new(isEnabled: false, ImmutableDictionary<string, string>.Empty); 18private readonly ImmutableDictionary<string, string> InstalledPackageToVersion; 20private ProjectState(bool isEnabled, ImmutableDictionary<string, string> installedPackageToVersion) 26public ProjectState(ImmutableDictionary<string, string> installedPackageToVersion)
Packaging\PackageInstallerServiceFactory.cs (4)
317var installedPackagesMap = await GetInstalledPackagesMapAsync(nugetService, projectGuid, cancellationToken).ConfigureAwait(false); 389var installedPackagesMap = await GetInstalledPackagesMapAsync(nugetService, projectGuid, cancellationToken).ConfigureAwait(false); 580var installedPackagesMap = await GetInstalledPackagesMapAsync(nugetService, projectGuid, cancellationToken).ConfigureAwait(false); 590private static async Task<ImmutableDictionary<string, string>> GetInstalledPackagesMapAsync(INuGetProjectService nugetService, Guid projectGuid, CancellationToken cancellationToken)
ProjectSystem\OpenTextBufferProvider.cs (2)
48private ImmutableDictionary<string, ITextBuffer> _monikerToTextBufferMap = ImmutableDictionary<string, ITextBuffer>.Empty.WithComparers(StringComparer.OrdinalIgnoreCase);
ProjectSystem\RuleSets\VisualStudioRuleSetManager.RuleSetFile.cs (3)
29private ImmutableDictionary<string, ReportDiagnostic> _specificDiagnosticOptions; 63_specificDiagnosticOptions = ImmutableDictionary<string, ReportDiagnostic>.Empty; 100public ImmutableDictionary<string, ReportDiagnostic> GetSpecificDiagnosticOptions()
ProjectSystem\VisualStudioWorkspaceImpl.cs (6)
81private ImmutableDictionary<ProjectId, IVsHierarchy?> _projectToHierarchyMap = ImmutableDictionary<ProjectId, IVsHierarchy?>.Empty; 82private ImmutableDictionary<ProjectId, Guid> _projectToGuidMap = ImmutableDictionary<ProjectId, Guid>.Empty; 90private ImmutableDictionary<ProjectId, Func<string?>> _projectToRuleSetFilePath = ImmutableDictionary<ProjectId, Func<string?>>.Empty;
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (1)
211var projectToHierarchyMap = _workspace._projectToHierarchyMap;
PullMemberUp\MainDialog\PullMemberUpDialogViewModel.cs (2)
30private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 37ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap)
PullMemberUp\SymbolDependentsBuilder.cs (1)
20public static ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> FindMemberToDependentsMap(
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
63var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationTokenSource.Token);
Snippets\SnippetExpansionClient.cs (4)
553var snippet = CreateMethodCallSnippet(methodName, includeMethod: true, [], ImmutableDictionary<string, string>.Empty); 631private static XDocument CreateMethodCallSnippet(string methodName, bool includeMethod, ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string> parameterValues) 865var newArguments = _state._arguments; 1176public ImmutableDictionary<string, string> _arguments = ImmutableDictionary.Create<string, string>();
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (4)
196Dictionary<Project, ImmutableDictionary<string, Document>>? filePathToDocumentMap = null; 251if (!filePathToDocumentMap.TryGetValue(project, out var filePathMap)) 286properties: ImmutableDictionary<string, string?>.Empty, 300private static async Task<ImmutableDictionary<string, Document>> GetFilePathToDocumentMapAsync(Project project, CancellationToken cancellationToken)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (17)
224var documentDiagnosticsToFixMap = await GetDocumentDiagnosticsToFixAsync( 228var projectDiagnosticsToFixMap = isSuppressionInSource 229? ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty 262var documentDiagnosticsPerLanguage = GetDocumentDiagnosticsMappedToNewSolution(documentDiagnosticsToFixMap, newSolution, language); 287var projectDiagnosticsPerLanguage = GetProjectDiagnosticsMappedToNewSolution(projectDiagnosticsToFixMap, newSolution, language); 404private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 406ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Builder? builder = null; 420return builder != null ? builder.ToImmutable() : ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 423private static ImmutableDictionary<Project, ImmutableArray<Diagnostic>> GetProjectDiagnosticsMappedToNewSolution(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectDiagnosticsToFixMap, Solution newSolution, string language) 425ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Builder? projectDiagsBuilder = null; 439return projectDiagsBuilder != null ? projectDiagsBuilder.ToImmutable() : ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 448private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 466return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 541private async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 548return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty;
Telemetry\Shared\AbstractAggregatingLog.cs (3)
32private ImmutableDictionary<string, (TAggregator aggregator, TelemetryEvent TelemetryEvent, object Lock)> _aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty; 126_aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty;
Telemetry\Shared\TelemetryLogProvider.cs (6)
23private ImmutableDictionary<FunctionId, VisualStudioTelemetryLog> _logs = ImmutableDictionary<FunctionId, VisualStudioTelemetryLog>.Empty; 28private ImmutableDictionary<FunctionId, AggregatingHistogramLog> _histogramLogs = ImmutableDictionary<FunctionId, AggregatingHistogramLog>.Empty; 33private ImmutableDictionary<FunctionId, AggregatingCounterLog> _counterLogs = ImmutableDictionary<FunctionId, AggregatingCounterLog>.Empty;
Microsoft.VisualStudio.LanguageServices.CodeLens (2)
ReferenceCodeLensProvider.cs (2)
107var projectVersions = await _lazyCodeLensCallbackService.Value.InvokeAsync<ImmutableDictionary<Guid, string>>(
Microsoft.VisualStudio.LanguageServices.DevKit (9)
src\VisualStudio\Core\Def\Telemetry\Shared\AbstractAggregatingLog.cs (3)
32private ImmutableDictionary<string, (TAggregator aggregator, TelemetryEvent TelemetryEvent, object Lock)> _aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty; 126_aggregations = ImmutableDictionary<string, (TAggregator, TelemetryEvent, object)>.Empty;
src\VisualStudio\Core\Def\Telemetry\Shared\TelemetryLogProvider.cs (6)
23private ImmutableDictionary<FunctionId, VisualStudioTelemetryLog> _logs = ImmutableDictionary<FunctionId, VisualStudioTelemetryLog>.Empty; 28private ImmutableDictionary<FunctionId, AggregatingHistogramLog> _histogramLogs = ImmutableDictionary<FunctionId, AggregatingHistogramLog>.Empty; 33private ImmutableDictionary<FunctionId, AggregatingCounterLog> _counterLogs = ImmutableDictionary<FunctionId, AggregatingCounterLog>.Empty;
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\RemoteLanguageServiceWorkspace.cs (2)
58private ImmutableDictionary<string, DocumentId> _openedDocs = ImmutableDictionary<string, DocumentId>.Empty;
Client\RemoteLanguageServiceWorkspaceHost.cs (2)
37private ImmutableDictionary<string, ProjectId> _loadedProjects = ImmutableDictionary.Create<string, ProjectId>(StringComparer.OrdinalIgnoreCase); 38private ImmutableDictionary<string, ProjectInfo> _loadedProjectInfo = ImmutableDictionary.Create<string, ProjectInfo>(StringComparer.OrdinalIgnoreCase);
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (3)
49ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 95ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 179properties:=ImmutableDictionary(Of String, String).Empty,
ProjectSystemShim\ConvertedVisualBasicProjectOptionsTests.vb (2)
143Optional ruleSetSpecificOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, 149ruleSetSpecificOptions = If(ruleSetSpecificOptions, ImmutableDictionary(Of String, ReportDiagnostic).Empty)
ProjectSystemShim\MockRuleSetFile.vb (3)
14Private ReadOnly _specificOptions As ImmutableDictionary(Of String, ReportDiagnostic) 16Public Sub New(generalOption As ReportDiagnostic, specificOptions As ImmutableDictionary(Of String, ReportDiagnostic)) 37Public Function GetSpecificDiagnosticOptions() As ImmutableDictionary(Of String, ReportDiagnostic) Implements IRuleSetFile.GetSpecificDiagnosticOptions
Microsoft.VisualStudio.LanguageServices.Xaml (2)
Features\InlineRename\XamlEditorInlineRenameService.cs (2)
35public Task<ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>> GetRenameContextAsync(IInlineRenameInfo inlineRenameInfo, IInlineRenameLocationSet inlineRenameLocationSet, CancellationToken cancellationToken) 37return Task.FromResult(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>>.Empty);
MSBuild (11)
CopyOnWriteDictionary.cs (11)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 301public ImmutableDictionary<string, V>.Enumerator GetEnumerator() 308ImmutableDictionary<string, V>.Enumerator enumerator = _backing.GetEnumerator(); 399ImmutableDictionary<string, V> snapshot = _backing;
Mvc.Api.Analyzers.Test (1)
ApiConventionAnalyzerIntegrationTest.cs (1)
311var specificDiagnosticOptions = compilationOptions.SpecificDiagnosticOptions.Add(
Roslyn.Diagnostics.Analyzers (129)
DiagnosticExtensions.cs (2)
26ImmutableDictionary<string, string?>? properties, 34ImmutableDictionary<string, string?>? properties,
ExportedPartsShouldHaveImportingConstructor.cs (5)
146var properties = Equals(constructor, missingImportingConstructor) ? ScenarioProperties.MissingAttribute : ScenarioProperties.MultipleConstructors; 164public static readonly ImmutableDictionary<string, string?> ImplicitConstructor = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(ImplicitConstructor)); 165public static readonly ImmutableDictionary<string, string?> NonPublicConstructor = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(NonPublicConstructor)); 166public static readonly ImmutableDictionary<string, string?> MissingAttribute = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(MissingAttribute)); 167public static readonly ImmutableDictionary<string, string?> MultipleConstructors = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(MultipleConstructors));
ImportingConstructorShouldBeObsolete.cs (5)
179public static readonly ImmutableDictionary<string, string?> MissingAttribute = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(MissingAttribute)); 180public static readonly ImmutableDictionary<string, string?> MissingDescription = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(MissingDescription)); 181public static readonly ImmutableDictionary<string, string?> IncorrectDescription = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(IncorrectDescription)); 182public static readonly ImmutableDictionary<string, string?> MissingError = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(MissingError)); 183public static readonly ImmutableDictionary<string, string?> ErrorSetToFalse = ImmutableDictionary.Create<string, string?>().Add(nameof(Scenario), nameof(ErrorSetToFalse));
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
BasicInvokeTheCorrectPropertyToEnsureCorrectUseSiteDiagnostics.vb (1)
29Private Shared ReadOnly s_propertiesToValidateMap As ImmutableDictionary(Of String, String) = New Dictionary(Of String, String)(StringComparer.OrdinalIgnoreCase) From
Roslyn.Test.PdbUtilities (2)
Reader\MockSymUnmanagedReader.cs (2)
21private readonly ImmutableDictionary<int, MethodDebugInfoBytes> _methodDebugInfoMap; 23public MockSymUnmanagedReader(ImmutableDictionary<int, MethodDebugInfoBytes> methodDebugInfoMap)
Roslyn.VisualStudio.Next.UnitTests (21)
Options\VisualStudioOptionStorageTests.cs (6)
74var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 101var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 149var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 166var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 178var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 200var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location));
Options\VisualStudioSettingsOptionPersisterTests.cs (2)
80private static readonly ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>> s_noFallbacks = 81ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>>.Empty;
Remote\SnapshotSerializationTests.cs (5)
427var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 448var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 701return new AnalyzerFileReference(original, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(original, shadow.Path))); 733private readonly ImmutableDictionary<string, string> _map; 735public MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string> map)
Services\SolutionServiceTests.cs (4)
169return solution.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 170.Add(LanguageNames.CSharp, StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty 173.Add(LanguageNames.VisualBasic, StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty 176.Add(LanguageNames.FSharp, StructuredAnalyzerConfigOptions.Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty
UnifiedSettings\UnifiedSettingsTests.cs (4)
33private static readonly ImmutableDictionary<IOption2, string> s_csharpUnifiedSettingsStorage = ImmutableDictionary<IOption2, string>.Empty. 161private static readonly ImmutableDictionary<IOption2, string> s_visualBasicUnifiedSettingsStorage = ImmutableDictionary<IOption2, string>.Empty.
RunTests (8)
AssemblyScheduler.cs (3)
38ImmutableDictionary<string, TimeSpan> testHistory) 79private static void LogLongTests(ImmutableDictionary<string, TimeSpan> testHistory) 97ImmutableDictionary<string, TimeSpan> testHistory)
HelixTestRunner.cs (1)
69var testHistory = await TestHistoryManager.GetTestHistoryAsync(options, cancellationToken);
TestHistoryManager.cs (4)
29public static async Task<ImmutableDictionary<string, TimeSpan>> GetTestHistoryAsync(Options options, CancellationToken cancellationToken) 50return ImmutableDictionary<string, TimeSpan>.Empty; 66return ImmutableDictionary<string, TimeSpan>.Empty; 75return ImmutableDictionary<string, TimeSpan>.Empty;
System.Collections.Immutable (148)
System\Collections\Immutable\IImmutableDictionaryInternal.cs (3)
9/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 13/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 17/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains
System\Collections\Immutable\ImmutableDictionary.cs (35)
11/// A set of initialization methods for instances of <see cref="ImmutableDictionary{TKey, TValue}"/>. 21public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>() where TKey : notnull 23return ImmutableDictionary<TKey, TValue>.Empty; 35public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? keyComparer) where TKey : notnull 37return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer); 50public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 52return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer); 62public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 64return ImmutableDictionary<TKey, TValue>.Empty.AddRange(items); 79public static ImmutableDictionary<TKey, TValue> CreateRangeWithOverwrite<TKey, TValue>( 83return ImmutableDictionary<TKey, TValue>.Empty.AddRange(items, ImmutableDictionary<TKey, TValue>.KeyCollisionBehavior.SetValue); 94public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 96return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer).AddRange(items); 112public static ImmutableDictionary<TKey, TValue> CreateRangeWithOverwrite<TKey, TValue>( 117return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer).AddRange(items, ImmutableDictionary<TKey, TValue>.KeyCollisionBehavior.SetValue); 129public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 131return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(items); 140public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>() where TKey : notnull 152public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IEqualityComparer<TKey>? keyComparer) where TKey : notnull 165public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 182public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 188return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer) 197public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this ImmutableDictionary<TKey, TValue>.Builder builder) where TKey : notnull 215public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 228public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull 242public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 257public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector) where TKey : notnull 271public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 275if (source is ImmutableDictionary<TKey, TValue> existingDictionary) 280return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(source); 291public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 303public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source) where TKey : notnull
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (24)
11/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Builder"/> class. 21/// While <see cref="ImmutableDictionary{TKey, TValue}.AddRange(IEnumerable{KeyValuePair{TKey, TValue}})"/> 52private ImmutableDictionary<TKey, TValue>? _immutable; 65/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.Builder"/> class. 68internal Builder(ImmutableDictionary<TKey, TValue> map) 97ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.AddRange(this, input); 422ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Add(key, value, KeyCollisionBehavior.SetValue, this.Origin); 435ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.AddRange(items, this.Origin); 503public ImmutableDictionary<TKey, TValue> ToImmutable() 508return _immutable ??= ImmutableDictionary<TKey, TValue>.Wrap(_root, _comparers, _count); 525ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Add(key, value, KeyCollisionBehavior.ThrowIfValueDifferent, this.Origin); 539return ImmutableDictionary<TKey, TValue>.ContainsKey(key, this.Origin); 543/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 547/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 551/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains 578ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Remove(key, this.Origin); 593return ImmutableDictionary<TKey, TValue>.TryGetValue(key, this.Origin, out value!); 601return ImmutableDictionary<TKey, TValue>.TryGetKey(equalKey, this.Origin, out actualKey); 633return ImmutableDictionary<TKey, TValue>.Contains(item, this.Origin);
System\Collections\Immutable\ImmutableDictionary_2.Comparers.cs (1)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Comparers"/> class.
System\Collections\Immutable\ImmutableDictionary_2.cs (43)
25public static readonly ImmutableDictionary<TKey, TValue> Empty = new ImmutableDictionary<TKey, TValue>(); 48/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}"/> class. 64/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}"/> class. 125public ImmutableDictionary<TKey, TValue> Clear() 172foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 189foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 300public ImmutableDictionary<TKey, TValue> Add(TKey key, TValue value) 304ImmutableDictionary<TKey, TValue>.MutationResult result = Add(key, value, KeyCollisionBehavior.ThrowIfValueDifferent, this.Origin); 311public ImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs) 318internal ImmutableDictionary<TKey, TValue> AddRange(ReadOnlySpan<KeyValuePair<TKey, TValue>> pairs, KeyCollisionBehavior collisionBehavior = KeyCollisionBehavior.ThrowIfValueDifferent) 326public ImmutableDictionary<TKey, TValue> SetItem(TKey key, TValue value) 330ImmutableDictionary<TKey, TValue>.MutationResult result = Add(key, value, KeyCollisionBehavior.SetValue, this.Origin); 339public ImmutableDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items) 343ImmutableDictionary<TKey, TValue>.MutationResult result = AddRange(items, this.Origin, KeyCollisionBehavior.SetValue); 350public ImmutableDictionary<TKey, TValue> Remove(TKey key) 354ImmutableDictionary<TKey, TValue>.MutationResult result = Remove(key, this.Origin); 361public ImmutableDictionary<TKey, TValue> RemoveRange(IEnumerable<TKey> keys) 366SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> root = _root; 374ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Remove(key, _comparers.KeyOnlyComparer, out result); 432public ImmutableDictionary<TKey, TValue> WithComparers(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) 448ImmutableDictionary<TKey, TValue>.Comparers comparers = _comparers.WithValueComparer(valueComparer); 455var set = new ImmutableDictionary<TKey, TValue>(comparers); 464public ImmutableDictionary<TKey, TValue> WithComparers(IEqualityComparer<TKey>? keyComparer) 470/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 474/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 478/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains 835private static ImmutableDictionary<TKey, TValue> EmptyWithComparers(Comparers comparers) 845/// Attempts to discover an <see cref="ImmutableDictionary{TKey, TValue}"/> instance beneath some enumerable sequence 849/// <param name="other">Receives the concrete <see cref="ImmutableDictionary{TKey, TValue}"/> typed value if one can be found.</param> 851private static bool TryCastToImmutableMap(IEnumerable<KeyValuePair<TKey, TValue>> sequence, [NotNullWhen(true)] out ImmutableDictionary<TKey, TValue>? other) 853other = sequence as ImmutableDictionary<TKey, TValue>; 944ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(key, value, origin.KeyOnlyComparer, origin.ValueComparer, behavior, out result); 950SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, newBucket, origin.HashBucketComparer); 962SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = origin.Root; 969ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result); 986SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = origin.Root; 993ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result); 1014SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, bucket.Remove(key, origin.KeyOnlyComparer, out result), origin.HashBucketComparer); 1047private static ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket> root, Comparers comparers, int count) 1061private ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket>? root, int adjustedCountIfDifferentRoot) 1081private ImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs, bool avoidToHashMap) 1090if (TryCastToImmutableMap(pairs, out ImmutableDictionary<TKey, TValue>? other)) 1096ImmutableDictionary<TKey, TValue>.MutationResult result = AddRange(pairs, this.Origin);
System\Collections\Immutable\ImmutableDictionary_2.Enumerator.cs (2)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Enumerator"/> struct. 39/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.Enumerator"/> struct.
System\Collections\Immutable\ImmutableDictionary_2.HashBucket.cs (3)
11/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 37/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 354/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket.Enumerator"/> struct.
System\Collections\Immutable\ImmutableDictionary_2.MutationInput.cs (4)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> class. 30/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> struct. 44/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> struct. 47internal MutationInput(ImmutableDictionary<TKey, TValue> map)
System\Collections\Immutable\ImmutableDictionary_2.MutationResult.cs (5)
7/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> class. 27/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> struct. 37/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> struct. 69internal ImmutableDictionary<TKey, TValue> Finalize(ImmutableDictionary<TKey, TValue> priorMap)
System\Collections\Immutable\ImmutableInterlocked.cs (28)
250public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 258ImmutableDictionary<TKey, TValue> map = Volatile.Read(ref location); 283public static TValue GetOrAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory) where TKey : notnull 287ImmutableDictionary<TKey, TValue> map = Volatile.Read(ref location); 309public static TValue GetOrAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue value) where TKey : notnull 311ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 322ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Add(key, value); 323ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 344public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory) where TKey : notnull 350ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 366ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 371ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 392public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory) where TKey : notnull 397ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 413ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 418ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 438public static bool TryAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue value) where TKey : notnull 440ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 451ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Add(key, value); 452ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 470public static bool TryUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue newValue, TValue comparisonValue) where TKey : notnull 473ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 486ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 487ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 504public static bool TryRemove<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, [MaybeNullWhen(false)] out TValue value) where TKey : notnull 506ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 517ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Remove(key); 518ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
112public INamedTypeSymbol? ImmutableDictionaryType => GetOrResolveType(typeof(ImmutableDictionary<,>), ref _ImmutableDictionaryType);
System.Windows.Forms.Analyzers.CSharp.Tests (16)
CompilerAnalyzerConfigOptions.cs (2)
19private readonly ImmutableDictionary<string, string> _backing; 21public CompilerAnalyzerConfigOptions(ImmutableDictionary<string, string> properties)
CompilerAnalyzerConfigOptionsProvider.cs (4)
16private readonly ImmutableDictionary<object, AnalyzerConfigOptions> _treeDict; 20ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, 24ImmutableDictionary<object, AnalyzerConfigOptions> treeDict, 39internal CompilerAnalyzerConfigOptionsProvider WithAdditionalTreeOptions(ImmutableDictionary<object, AnalyzerConfigOptions> treeDict)
ProjectFileReaderTests.cs (7)
49CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 75CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 113CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 150CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 172CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 192CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions); 210CompilerAnalyzerConfigOptionsProvider provider = new(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, configOptions);
Verifiers\CSharpVerifierHelper.cs (3)
19internal static ImmutableDictionary<string, ReportDiagnostic> NullableWarnings { get; } = GetNullableWarningsFromCompiler(); 21private static ImmutableDictionary<string, ReportDiagnostic> GetNullableWarningsFromCompiler() 25var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions;
Test.Utilities (98)
CSharpCodeFixVerifier`2+Test.cs (3)
43internal static readonly ImmutableDictionary<string, ReportDiagnostic> NullableWarnings = GetNullableWarningsFromCompiler(); 50private static ImmutableDictionary<string, ReportDiagnostic> GetNullableWarningsFromCompiler() 54var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions;
CSharpCodeRefactoringVerifier`1+Test.cs (1)
24private static ImmutableDictionary<string, ReportDiagnostic> NullableWarnings
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
Text.Analyzers (117)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (3)
13internal static readonly ImmutableDictionary<string, string> EmptyDictionary = ImmutableDictionary.Create<string, string>(KeyComparer); 19internal readonly ImmutableDictionary<string, string> Options; 21public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
73internal static int CombineValues<TKey, TValue>(ImmutableDictionary<TKey, TValue> values, int maxItemsToHash = int.MaxValue)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
148internal static GeneratedKind GetGeneratedCodeKindFromOptions(ImmutableDictionary<string, string> options)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
621public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items) 632public static ImmutableDictionary<K, V> ToImmutableDictionaryOrEmpty<K, V>(this IEnumerable<KeyValuePair<K, V>>? items, IEqualityComparer<K>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (8)
390/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 410/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 430/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 458/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 496/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 532/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 558/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 586/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (3)
20/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 24/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 34/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
src\Dependencies\PooledObjects\PooledDictionary.cs (3)
29public ImmutableDictionary<K, V> ToImmutableDictionaryAndFree() 31var result = this.ToImmutableDictionary(this.Comparer); 36public ImmutableDictionary<K, V> ToImmutableDictionary() => this.ToImmutableDictionary(this.Comparer);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (12)
28ImmutableDictionary<string, string?>? properties, 36ImmutableDictionary<string, string?>? properties, 55ImmutableDictionary<string, string?>? properties, 65ImmutableDictionary<string, string?>? properties, 90ImmutableDictionary<string, string?>? properties, 103properties: ImmutableDictionary<string, string?>.Empty, 109ImmutableDictionary<string, string?>? properties, 117ImmutableDictionary<string, string?>? properties, 144ImmutableDictionary<string, string?>? properties, 179ImmutableDictionary<string, string?>? properties, 245var options = (ImmutableDictionary<string, ReportDiagnostic>)s_syntaxTreeDiagnosticOptionsProperty.GetValue(tree)!;
src\RoslynAnalyzers\Utilities\Compiler\HashUtilities.cs (2)
70internal static int Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary) 78internal static void Combine<TKey, TValue>(ImmutableDictionary<TKey, TValue> dictionary, ref RoslynHashCode hashCode)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (3)
33ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.Empty); 36private readonly ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> _perTreeOptions; 38private AggregateCategorizedAnalyzerConfigOptions(Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>? globalOptions, ImmutableDictionary<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>> perTreeOptions)
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (19)
31private readonly ImmutableDictionary<string, TValue> _names; 32private readonly ImmutableDictionary<ISymbol, TValue> _symbols; 54private readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> _wildcardNamesBySymbolKind; 63private SymbolNamesWithValueOption(ImmutableDictionary<string, TValue> names, ImmutableDictionary<ISymbol, TValue> symbols, 64ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> wildcardNamesBySymbolKind) 75_names = ImmutableDictionary<string, TValue>.Empty; 76_symbols = ImmutableDictionary<ISymbol, TValue>.Empty; 77_wildcardNamesBySymbolKind = ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>>.Empty; 310if (_wildcardNamesBySymbolKind.TryGetValue(symbol.Kind, out var names) && 320if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var value) && 330if (_wildcardNamesBySymbolKind.TryGetValue(AllKinds, out var allKindsValue) && 373internal ref readonly ImmutableDictionary<string, TValue> Names => ref _symbolNamesWithValueOption._names; 375internal ref readonly ImmutableDictionary<ISymbol, TValue> Symbols => ref _symbolNamesWithValueOption._symbols; 377internal ref readonly ImmutableDictionary<SymbolKind, ImmutableDictionary<string, TValue>> WildcardNamesBySymbolKind => ref _symbolNamesWithValueOption._wildcardNamesBySymbolKind;
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (5)
22private static readonly ConditionalWeakTable<ImmutableDictionary<string, string>, SyntaxTreeCategorizedAnalyzerConfigOptions> s_perTreeOptionsCache = new(); 38var optionsMap = TryGetBackingOptionsDictionary(analyzerConfigOptions); 52static ImmutableDictionary<string, string>? TryGetBackingOptionsDictionary(AnalyzerConfigOptions analyzerConfigOptions) 58return type.GetField("_backing", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string> ?? 59type.GetField("_analyzerOptions", flags)?.GetValue(analyzerConfigOptions) as ImmutableDictionary<string, string>;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (3)
19public ImmutableDictionary<TKey, TValue> ToImmutableDictionaryAndFree<TKey, TValue>( 23ImmutableDictionary<TKey, TValue> result; 26result = ImmutableDictionary<TKey, TValue>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
48public static readonly StructuredAnalyzerConfigOptions Empty = Create(new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
38ImmutableDictionary<string, ReportDiagnostic>? treeOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (3)
40public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures(ControlFlowGraph cfg) 49ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder lvalueFlowCaptureIdBuilder = null; 80return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable() : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
181public ImmutableDictionary<CaptureId, FlowCaptureKind> LValueFlowCapturesInGraph { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
13ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 33public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } = symbolWritesMap;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (5)
57var serializedNameMap = AssignNamesToNamingStyleElements(symbolSpecifications, namingStyles); 58var ruleNameMap = AssignNamesToNamingStyleRules(rules, serializedNameMap); 119private static ImmutableDictionary<Guid, string> AssignNamesToNamingStyleElements( 170private static ImmutableDictionary<NamingRule, string> AssignNamesToNamingStyleRules(ImmutableArray<NamingRule> namingRules, ImmutableDictionary<Guid, string> serializedNameMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (4)
113=> CreateSerializerForEnum(map, ImmutableDictionary<string, T>.Empty); 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 130var alternativeMap = ImmutableDictionary<string, T>.Empty.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
13using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 35!treeMap.TryGetValue((semanticModel.SyntaxTree, namespaceId), out var symbolMap))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
20private readonly ImmutableDictionary<TKey, TValue> _forwardMap; 21private readonly ImmutableDictionary<TValue, TKey> _backwardMap; 35private BidirectionalMap(ImmutableDictionary<TKey, TValue> forwardMap, ImmutableDictionary<TValue, TKey> backwardMap)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CompilerUtilities\ImmutableDictionaryExtensions.cs (2)
12public static bool KeysEqual<TKey, TValue>(this ImmutableDictionary<TKey, TValue> self, ImmutableDictionary<TKey, TValue> other)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (2)
158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
42public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
41ImmutableDictionary<string, string?> properties,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
284ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewFieldMap, bool isContainedInUnsafeType) 306ImmutableArray<IParameterSymbol> parameters, ImmutableDictionary<string, string>? parameterToNewPropertyMap, bool isContainedInUnsafeType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
459ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 460ImmutableDictionary<string, string>? parameterToNewMemberMap,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
18private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (9)
59private ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> _semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 74var map = _semanticModelMap; 83_semanticModelMap = ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>.Empty; 115var originalMap = _semanticModelMap; 127var updatedMap = await ComputeUpdatedMapAsync(originalMap, document, bodyNode, cancellationToken).ConfigureAwait(false); 139private static async Task<ImmutableDictionary<DocumentId, SemanticModelReuseInfo?>> ComputeUpdatedMapAsync( 140ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 177ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (2)
25private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 26= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (6)
27private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 28= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 34private ImmutableDictionary<string, MefLanguageServices> _languageServicesMap 35= ImmutableDictionary<string, MefLanguageServices>.Empty; 74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear()); 177var currentServicesMap = _languageServicesMap;
xunit.assert (2)
DictionaryAsserts.cs (2)
186 ImmutableDictionary<TKey, TValue> collection) 314 ImmutableDictionary<TKey, TValue> collection)