4 instantiations of ImmutableHashSet
System.Collections.Immutable (4)
System\Collections\Immutable\ImmutableHashSet_1.cs (4)
27public static readonly ImmutableHashSet<T> Empty = new ImmutableHashSet<T>(SortedInt32KeyNode<HashBucket>.EmptyNode, EqualityComparer<T>.Default, 0); 426var result = new ImmutableHashSet<T>(equalityComparer); 983return new ImmutableHashSet<T>(root, equalityComparer, count); 1015return (root != _root) ? new ImmutableHashSet<T>(root, _equalityComparer, adjustedCountIfDifferentRoot) : this;
1409 references to ImmutableHashSet
AnalyzerRunner (11)
CodeRefactoringRunner.cs (5)
30private readonly ImmutableDictionary<string, ImmutableHashSet<int>> _syntaxKinds; 77var syntaxKinds = _syntaxKinds[document.Project.Language]; 125private static ImmutableDictionary<string, ImmutableHashSet<int>> GetSyntaxKinds(ImmutableHashSet<string> refactoringNodes) 133var builder = ImmutableDictionary.CreateBuilder<string, ImmutableHashSet<int>>();
Options.cs (6)
19public readonly ImmutableHashSet<string> AnalyzerNames; 20public readonly ImmutableHashSet<string> RefactoringNodes; 47ImmutableHashSet<string> analyzerIds, 48ImmutableHashSet<string> refactoringNodes, 79ImmutableHashSet<string> analyzerIds, 80ImmutableHashSet<string> refactoringNodes,
Aspire.Dashboard (1)
ResourceService\DashboardClient.cs (1)
56private ImmutableHashSet<Channel<IReadOnlyList<ResourceViewModelChange>>> _outgoingChannels = [];
Aspire.Hosting (2)
Dashboard\ResourcePublisher.cs (2)
23private ImmutableHashSet<Channel<ResourceSnapshotChange>> _outgoingChannels = []; 86ImmutableHashSet<Channel<ResourceSnapshotChange>> channels;
Aspire.Hosting.Dapr (1)
DaprSidecarOptions.cs (1)
148public IImmutableSet<string> ResourcesPaths { get; init; } = ImmutableHashSet<string>.Empty;
BuildActionTelemetryTable (1)
Program.cs (1)
25private static ImmutableHashSet<string> IgnoredCodeActions { get; } = new HashSet<string>()
IdeCoreBenchmarks (3)
CSharpIdeAnalyzerBenchmarks.cs (1)
55refactoringNodes: ImmutableHashSet<string>.Empty,
IncrementalAnalyzerBenchmarks.cs (2)
52analyzerIds: ImmutableHashSet<string>.Empty, 53refactoringNodes: ImmutableHashSet<string>.Empty,
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
24return ImmutableHashSet<string>.Empty;
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
49public ImmutableHashSet<char> TriggerCharacters { get; } = ImmutableHashSet.Create(' ');
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
41public ImmutableHashSet<char> TriggerCharacters { get; } = ImmutableHashSet.Create(
Microsoft.AspNetCore.Components.Endpoints (14)
FormMapping\Converters\CollectionAdapters\ImmutableHashSetBufferAdapter.cs (10)
8internal sealed class ImmutableHashSetBufferAdapter<TElement> : ICollectionBufferAdapter<ImmutableHashSet<TElement>, ImmutableHashSet<TElement>.Builder, TElement> 10public static ImmutableHashSet<TElement>.Builder CreateBuffer() => ImmutableHashSet.CreateBuilder<TElement>(); 12public static ImmutableHashSet<TElement>.Builder Add(ref ImmutableHashSet<TElement>.Builder buffer, TElement element) 18public static ImmutableHashSet<TElement> ToResult(ImmutableHashSet<TElement>.Builder buffer) => buffer.ToImmutable(); 26ImmutableHashSet<TElement>, 28ImmutableHashSet<TElement>.Builder, 30ImmutableHashSet<TElement>.Builder,
FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
58var _ when type == (typeof(ImmutableHashSet<TElement>)) => true, 153var _ when type.IsAssignableTo(typeof(ImmutableHashSet<TElement>)) => 154new CollectionConverter<ImmutableHashSet<TElement>, ImmutableHashSetBufferAdapter<TElement>, ImmutableHashSet<TElement>.Builder, TElement>(elementTypeConverter),
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Binding\FormDataMapperTests.cs (5)
825var expected = ImmutableHashSet.CreateRange(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }); 826CanDeserialize_Collection<ImmutableHashSet<int>, ImmutableHashSet<int>, int>(expected); 865var expected = ImmutableHashSet.CreateRange(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }); 866CanDeserialize_Collection<IImmutableSet<int>, ImmutableHashSet<int>, int>(expected);
Microsoft.AspNetCore.Http.Extensions (14)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ImmutableHashSetBufferAdapter.cs (10)
8internal sealed class ImmutableHashSetBufferAdapter<TElement> : ICollectionBufferAdapter<ImmutableHashSet<TElement>, ImmutableHashSet<TElement>.Builder, TElement> 10public static ImmutableHashSet<TElement>.Builder CreateBuffer() => ImmutableHashSet.CreateBuilder<TElement>(); 12public static ImmutableHashSet<TElement>.Builder Add(ref ImmutableHashSet<TElement>.Builder buffer, TElement element) 18public static ImmutableHashSet<TElement> ToResult(ImmutableHashSet<TElement>.Builder buffer) => buffer.ToImmutable(); 26ImmutableHashSet<TElement>, 28ImmutableHashSet<TElement>.Builder, 30ImmutableHashSet<TElement>.Builder,
src\Components\Endpoints\src\FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
58var _ when type == (typeof(ImmutableHashSet<TElement>)) => true, 153var _ when type.IsAssignableTo(typeof(ImmutableHashSet<TElement>)) => 154new CollectionConverter<ImmutableHashSet<TElement>, ImmutableHashSetBufferAdapter<TElement>, ImmutableHashSet<TElement>.Builder, TElement>(elementTypeConverter),
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
RequestDelegateGeneratorSources.cs (2)
495public static string GetGeneratedRouteBuilderExtensionsSource(string endpoints, string helperMethods, string helperTypes, ImmutableHashSet<string> verbs) => $$""" 628public static string GetVerbs(ImmutableHashSet<string> verbs)
Microsoft.Build (23)
Construction\Solution\SolutionProjectGenerator.cs (1)
80internal static readonly ImmutableHashSet<string> _defaultTargetNames = ImmutableHashSet.Create(StringComparer.OrdinalIgnoreCase,
Definition\Project.cs (1)
2535private ImmutableHashSet<string>.Builder _fragmentStrings;
Evaluation\LazyItemEvaluator.cs (10)
180public void Apply(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore) 235private void AddItemsToCache(ImmutableHashSet<string> globsToIgnore, OrderedItemDataCollection items) 257public ImmutableList<I> GetMatchedItems(ImmutableHashSet<string> globsToIgnore) 271public OrderedItemDataCollection.Builder GetItemData(ImmutableHashSet<string> globsToIgnore) 317private static OrderedItemDataCollection.Builder ComputeItems(LazyItemList lazyItemList, ImmutableHashSet<string> globsToIgnore) 325Stack<ImmutableHashSet<string>> globsToIgnoreStack = null; 329var globsToIgnoreFromFutureOperations = globsToIgnoreStack?.Peek() ?? globsToIgnore; 343globsToIgnoreStack ??= new Stack<ImmutableHashSet<string>>(); 362ImmutableHashSet<string> currentGlobsToIgnore = globsToIgnoreStack == null ? globsToIgnore : globsToIgnoreStack.Peek(); 502return _itemLists.Values.SelectMany(itemList => itemList.GetItemData(ImmutableHashSet<string>.Empty))
Evaluation\LazyItemEvaluator.EvaluatorData.cs (1)
52? items.GetMatchedItems(globsToIgnore: ImmutableHashSet<string>.Empty)
Evaluation\LazyItemEvaluator.IItemOperation.cs (1)
14void Apply(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore);
Evaluation\LazyItemEvaluator.IncludeOperation.cs (2)
38protected override ImmutableArray<I> SelectItems(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore) 145private static ISet<string> BuildExcludePatternsForGlobs(ImmutableHashSet<string> globsToIgnore, ImmutableList<string>.Builder excludePatterns)
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (3)
55public void Apply(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore) 65protected virtual void ApplyImpl(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore) 75protected virtual ImmutableArray<I> SelectItems(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore)
Evaluation\LazyItemEvaluator.RemoveOperation.cs (2)
44protected override void ApplyImpl(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore) 95public ImmutableHashSet<string>.Builder GetRemovedGlobs()
Evaluation\LazyItemEvaluator.UpdateOperation.cs (1)
44protected override void ApplyImpl(OrderedItemDataCollection.Builder listBuilder, ImmutableHashSet<string> globsToIgnore)
MSBuildLoadContext.cs (1)
24internal static readonly ImmutableHashSet<string> WellKnownAssemblyNames =
Microsoft.Build.Engine.OM.UnitTests (8)
Definition\Project_Tests.cs (8)
21using GlobResultList = System.Collections.Generic.List<(string, string[], System.Collections.Immutable.ImmutableHashSet<string>, System.Collections.Immutable.ImmutableHashSet<string>)>; 3655var expectedExcludes = new[] { "1", "*", "3" }.ToImmutableHashSet(); 3795var expectedExcludes = new[] { "1", "*", "3" }.ToImmutableHashSet(); 3798("A", expectedIncludes, expectedExcludes, ImmutableHashSet<string>.Empty) 3821("A", new []{"*"}, new[] {"*"}.ToImmutableHashSet(), ImmutableHashSet<string>.Empty), 3850("A", new []{"*"}, ImmutableHashSet<string>.Empty, ImmutableHashSet<string>.Empty)
Microsoft.Build.Engine.UnitTests (1)
EvaluationProfiler_Tests.cs (1)
255var allUniqueIds = allIds.ToImmutableHashSet();
Microsoft.Build.Tasks.Core (2)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigCache.cs (2)
22private readonly ImmutableHashSet<string> _filesInDirectories = ImmutableHashSet<string>.Empty;
Microsoft.CodeAnalysis (191)
Binding\BindingDiagnosticBag.cs (1)
162internal void AddDependencies(ImmutableHashSet<TAssemblySymbol>? dependencies)
Binding\UseSiteInfo.cs (21)
36public readonly ImmutableHashSet<TAssemblySymbol>? SecondaryDependencies; 43public UseSiteInfo(ImmutableHashSet<TAssemblySymbol>? secondaryDependencies) : 58public UseSiteInfo(DiagnosticInfo? diagnosticInfo, TAssemblySymbol? primaryDependency, ImmutableHashSet<TAssemblySymbol>? secondaryDependencies) 66SecondaryDependencies = secondaryDependencies ?? ImmutableHashSet<TAssemblySymbol>.Empty; 90public void MergeDependencies(ref TAssemblySymbol? primaryDependency, ref ImmutableHashSet<TAssemblySymbol>? secondaryDependencies) 92secondaryDependencies = (secondaryDependencies ?? ImmutableHashSet<TAssemblySymbol>.Empty).Union(SecondaryDependencies ?? ImmutableHashSet<TAssemblySymbol>.Empty); 456/// - dependencies as a <see cref="ImmutableHashSet{TAssemblySymbol}"/>, or 457/// - a <see cref="Boxed"/> tuple of a <see cref="DiagnosticInfo"/> and a <see cref="ImmutableHashSet{TAssemblySymbol}"/>. 475Initialize(diagnosticInfo, dependencies: ImmutableHashSet<TAssemblySymbol>.Empty); 483private static ImmutableHashSet<TAssemblySymbol> GetDependenciesToCache(TAssemblySymbol? primaryDependency, UseSiteInfo<TAssemblySymbol> useSiteInfo) 485var secondaryDependencies = useSiteInfo.SecondaryDependencies ?? ImmutableHashSet<TAssemblySymbol>.Empty; 498Expand(_info, out var diagnosticInfo, out var dependencies); 508private void Initialize(DiagnosticInfo? diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies) 513private static object? Compact(DiagnosticInfo? diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies) 557Expand(info, out var diagnosticInfo, out var dependencies); 561private static void Expand(object? info, out DiagnosticInfo? diagnosticInfo, out ImmutableHashSet<TAssemblySymbol>? dependencies) 575case ImmutableHashSet<TAssemblySymbol> a: 599public readonly ImmutableHashSet<TAssemblySymbol> Dependencies; 601public Boxed(DiagnosticInfo diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies)
Collections\CollectionsExtensions.cs (1)
23internal static bool IsNullOrEmpty<T>([NotNullWhen(returnValue: false)] this ImmutableHashSet<T>? hashSet)
Collections\ImmutableHashSetExtensions.cs (4)
14/// Performs a <see cref="ImmutableHashSet{T}.SetEquals"/> comparison without allocating an intermediate 18public static bool SetEqualsWithoutIntermediateHashSet<T>(this ImmutableHashSet<T> set, ImmutableHashSet<T> other) 28var otherSet = other.WithComparer(set.KeyComparer);
CommandLine\AnalyzerConfig.cs (2)
71internal static ImmutableHashSet<string> ReservedKeys { get; } 87internal static ImmutableHashSet<string> ReservedValues { get; }
CommandLine\ErrorLogger.cs (1)
37ImmutableHashSet<ReportDiagnostic>? EffectiveSeverities,
CommandLine\SarifV2ErrorLogger.cs (3)
230private ImmutableArray<(string DescriptorId, int DescriptorIndex, ImmutableHashSet<ReportDiagnostic> EffectiveSeverities)> WriteRules() 232var effectiveSeveritiesBuilder = ArrayBuilder<(string DescriptorId, int DescriptorIndex, ImmutableHashSet<ReportDiagnostic> EffectiveSeverities)>.GetInstance(_descriptors.Count); 348private void WriteInvocations(ImmutableArray<(string DescriptorId, int DescriptorIndex, ImmutableHashSet<ReportDiagnostic> EffectiveSeverities)> effectiveSeverities)
DiagnosticAnalyzer\AnalysisResult.cs (5)
91var excludedAnalyzersSet = excludedAnalyzers.Any() ? excludedAnalyzers.ToImmutableHashSet() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 95private ImmutableArray<Diagnostic> GetDiagnostics(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers) 113ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers, 133ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (3)
508var analyzersSet = analyzers.ToImmutableHashSet(); 524ImmutableHashSet<DiagnosticAnalyzer> analyzers, 560ImmutableHashSet<DiagnosticAnalyzer> analyzers,
DiagnosticAnalyzer\AnalysisScope.cs (3)
23private readonly Lazy<ImmutableHashSet<DiagnosticAnalyzer>> _lazyAnalyzersSet; 155_lazyAnalyzersSet = new Lazy<ImmutableHashSet<DiagnosticAnalyzer>>(CreateAnalyzersSet); 179private ImmutableHashSet<DiagnosticAnalyzer> CreateAnalyzersSet() => Analyzers.ToImmutableHashSet();
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (3)
70private readonly Dictionary<string, ImmutableHashSet<string>> _knownAssemblyPathsBySimpleName = new(StringComparer.OrdinalIgnoreCase); 142if (!_knownAssemblyPathsBySimpleName.TryGetValue(simpleName, out var paths)) 308ImmutableHashSet<string>? paths;
DiagnosticAnalyzer\AnalyzerDriver.cs (41)
94private ImmutableHashSet<DiagnosticAnalyzer>? _lazyUnsuppressedAnalyzers; 99protected ImmutableHashSet<DiagnosticAnalyzer> UnsuppressedAnalyzers 134private ImmutableHashSet<DiagnosticAnalyzer>? _lazyCompilationEndAnalyzers; 135private ImmutableHashSet<DiagnosticAnalyzer> CompilationEndAnalyzers 186private ImmutableHashSet<DiagnosticAnalyzer>? _lazyNonConfigurableAndCustomConfigurableAnalyzers; 191private ImmutableHashSet<DiagnosticAnalyzer> NonConfigurableAndCustomConfigurableAnalyzers 200private ImmutableHashSet<DiagnosticAnalyzer>? _lazySymbolStartAnalyzers; 205private ImmutableHashSet<DiagnosticAnalyzer> SymbolStartAnalyzers 247private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>? _lazyGeneratedCodeSymbolsForTreeMap; 252private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>> GeneratedCodeSymbolsForTreeMap 261private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 266private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 419_lazyGeneratedCodeSymbolsForTreeMap = new Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>(); 422_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 531private ImmutableHashSet<DiagnosticAnalyzer> ComputeNonConfigurableAndCustomConfigurableAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers, CancellationToken cancellationToken) 550private ImmutableHashSet<DiagnosticAnalyzer> ComputeSymbolStartAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers) 565ImmutableHashSet<DiagnosticAnalyzer> analyzers, 583private static bool ComputeShouldTreatAllCodeAsNonGeneratedCode(ImmutableHashSet<DiagnosticAnalyzer> analyzers, ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap) 898var analyzersSuppressedForSomeTree = SuppressedAnalyzersForTreeMap.SelectMany(kvp => kvp.Value).ToImmutableHashSet(); 931var effectiveSeverities = GetEffectiveSeverities(descriptor, AnalyzerExecutor.Compilation, AnalyzerExecutor.AnalyzerOptions, cancellationToken); 940static ImmutableHashSet<ReportDiagnostic> GetEffectiveSeverities( 1263var generatedCodeSymbolsInTree = getOrComputeGeneratedCodeSymbolsInTree(location.SourceTree, compilation, cancellationToken); 1287ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1292ImmutableHashSet<ISymbol>? generatedCodeSymbols; 1305ImmutableHashSet<ISymbol>? existingGeneratedCodeSymbols; 1318static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1324return ImmutableHashSet<ISymbol>.Empty; 1331ImmutableHashSet<ISymbol>.Builder? generatedSymbolsBuilder = null; 1344return generatedSymbolsBuilder != null ? generatedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty; 1357if (!SuppressedAnalyzersForTreeMap.TryGetValue(tree, out var suppressedAnalyzers)) 1365private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1369return ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1372ImmutableHashSet<DiagnosticAnalyzer>.Builder? suppressedAnalyzersBuilder = null; 1421return suppressedAnalyzersBuilder != null ? suppressedAnalyzersBuilder.ToImmutable() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1497private static ImmutableHashSet<DiagnosticAnalyzer> MakeCompilationEndAnalyzers(ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationEndActionsByAnalyzer) 2023private static async Task<(AnalyzerActions actions, ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers)> GetAnalyzerActionsAsync( 2044var unsuppressedAnalyzers = unsuppressedAnalyzersBuilder.ToImmutableHashSet(); 2225ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2250ImmutableHashSet<DiagnosticAnalyzer> analyzers,
DiagnosticAnalyzer\AnalyzerFileReference.cs (12)
212internal ImmutableSortedDictionary<string, ImmutableHashSet<string>> GetAnalyzerTypeNameMap() 223private static ImmutableSortedDictionary<string, ImmutableHashSet<string>> GetAnalyzerTypeNameMap(string fullPath, Type attributeType, AttributeLanguagesFunc languagesFunc) 227Dictionary<string, ImmutableHashSet<string>.Builder> typeNameMap = new Dictionary<string, ImmutableHashSet<string>.Builder>(StringComparer.OrdinalIgnoreCase); 376private ImmutableSortedDictionary<string, ImmutableHashSet<string>>? _lazyExtensionTypeNameMap; 451internal ImmutableSortedDictionary<string, ImmutableHashSet<string>> GetExtensionTypeNameMap() 464ImmutableSortedDictionary<string, ImmutableHashSet<string>> analyzerTypeNameMap; 512ImmutableSortedDictionary<string, ImmutableHashSet<string>> analyzerTypeNameMap; 576private ImmutableArray<TExtension> GetLanguageSpecificAnalyzers(Assembly analyzerAssembly, ImmutableSortedDictionary<string, ImmutableHashSet<string>> analyzerTypeNameMap, string language, ref bool reportedError) 578ImmutableHashSet<string>? languageSpecificAnalyzerTypeNames; 586private ImmutableArray<TExtension> GetAnalyzersForTypeNames(Assembly analyzerAssembly, ImmutableHashSet<string> analyzerTypeNames, ref bool reportedError) 648static IEnumerable<string> shuffle(ImmutableHashSet<string> source)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
376var suppressorsInAnalysisScope = analysisScope.Analyzers.OfType<DiagnosticSuppressor>().ToImmutableHashSet();
InternalUtilities\MultiDictionary.cs (10)
24private ImmutableHashSet<V>.Enumerator _values; 37var set = v._value as ImmutableHashSet<V>; 121var set = _value as ImmutableHashSet<V>; 134_equalityComparer = equalityComparer ?? ImmutableHashSet<V>.Empty.KeyComparer; 156var set = _value as ImmutableHashSet<V>; 172var set = _value as ImmutableHashSet<V>;
MetadataReader\PEModule.cs (6)
1397Func<string, TypedConstant, bool, (bool IsCallConvs, ImmutableHashSet<INamedTypeSymbolInternal>? CallConvs)> unmanagedCallersOnlyDecoder) 1408var unmanagedConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 1482internal ImmutableHashSet<string> GetStringValuesOfNotNullIfNotNullAttribute(EntityHandle token) 1486var result = ImmutableHashSet<string>.Empty;
src\Dependencies\Collections\ImmutableSegmentedHashSet.cs (1)
81/// <inheritdoc cref="ImmutableHashSet.ToImmutableHashSet{TSource}(ImmutableHashSet{TSource}.Builder)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (24)
18/// best for <see cref="ImmutableHashSet{T}"/>.</para> 27/// <description><see cref="ImmutableHashSet{T}"/> Complexity</description> 66/// <inheritdoc cref="ImmutableHashSet{T}.Empty"/> 76/// <inheritdoc cref="ImmutableHashSet{T}.KeyComparer"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Count"/> 84/// <inheritdoc cref="ImmutableHashSet{T}.IsEmpty"/> 105/// <inheritdoc cref="ImmutableHashSet{T}.Add(T)"/> 128/// <inheritdoc cref="ImmutableHashSet{T}.Clear()"/> 141/// <inheritdoc cref="ImmutableHashSet{T}.Contains(T)"/> 145/// <inheritdoc cref="ImmutableHashSet{T}.Except(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.GetEnumerator()"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Intersect(IEnumerable{T})"/> 195/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSubsetOf(IEnumerable{T})"/> 199/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSupersetOf(IEnumerable{T})"/> 203/// <inheritdoc cref="ImmutableHashSet{T}.IsSubsetOf(IEnumerable{T})"/> 207/// <inheritdoc cref="ImmutableHashSet{T}.IsSupersetOf(IEnumerable{T})"/> 211/// <inheritdoc cref="ImmutableHashSet{T}.Overlaps(IEnumerable{T})"/> 215/// <inheritdoc cref="ImmutableHashSet{T}.Remove(T)"/> 233/// <inheritdoc cref="ImmutableHashSet{T}.SetEquals(IEnumerable{T})"/> 237/// <inheritdoc cref="ImmutableHashSet{T}.SymmetricExcept(IEnumerable{T})"/> 263/// <inheritdoc cref="ImmutableHashSet{T}.TryGetValue(T, out T)"/> 276/// <inheritdoc cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> 295/// <inheritdoc cref="ImmutableHashSet{T}.ToBuilder()"/> 302/// <inheritdoc cref="ImmutableHashSet{T}.WithComparer(IEqualityComparer{T}?)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (19)
24/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 31/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 36/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 40/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 44/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 48/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 63/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 67/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 71/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 75/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 87/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 91/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 95/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 99/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 103/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 107/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 111/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Enumerator.cs (5)
13/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator"/> 25/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Current"/> 30/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Dispose()"/> 34/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.MoveNext()"/> 38/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Reset()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (19)
35/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 53/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 74/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 100/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 104/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 165/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 169/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 181/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 185/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 189/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 193/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 202/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 206/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 210/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 223/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 261/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
Symbols\Attributes\UnmanagedCallersOnlyAttributeData.cs (6)
13internal static readonly UnmanagedCallersOnlyAttributeData Uninitialized = new UnmanagedCallersOnlyAttributeData(callingConventionTypes: ImmutableHashSet<INamedTypeSymbolInternal>.Empty); 14internal static readonly UnmanagedCallersOnlyAttributeData AttributePresentDataNotBound = new UnmanagedCallersOnlyAttributeData(callingConventionTypes: ImmutableHashSet<INamedTypeSymbolInternal>.Empty); 15private static readonly UnmanagedCallersOnlyAttributeData PlatformDefault = new UnmanagedCallersOnlyAttributeData(callingConventionTypes: ImmutableHashSet<INamedTypeSymbolInternal>.Empty); 19internal static UnmanagedCallersOnlyAttributeData Create(ImmutableHashSet<INamedTypeSymbolInternal>? callingConventionTypes) 26public readonly ImmutableHashSet<INamedTypeSymbolInternal> CallingConventionTypes; 28private UnmanagedCallersOnlyAttributeData(ImmutableHashSet<INamedTypeSymbolInternal> callingConventionTypes)
Microsoft.CodeAnalysis.CodeStyle (123)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (3)
67ImmutableHashSet<IOption2> options, 96protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions) 116private static void AddDiagnosticIdToOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options)
src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
73ImmutableHashSet<IOption2> options, 112protected AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions, PerLanguageOption2<bool>? fadingOption)
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (8)
23private static readonly ConcurrentDictionary<string, ImmutableHashSet<IOption2>> s_diagnosticIdToOptionMap = new(); 24private static readonly ConcurrentDictionary<string, ConcurrentDictionary<string, ImmutableHashSet<IOption2>>> s_diagnosticIdToLanguageSpecificOptionsMap = new(); 27public static bool TryGetMappedOptions(string diagnosticId, string language, [NotNullWhen(true)] out ImmutableHashSet<IOption2>? options) 39public static void AddOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options) 71var map = s_diagnosticIdToLanguageSpecificOptionsMap.GetOrAdd(language, _ => new ConcurrentDictionary<string, ImmutableHashSet<IOption2>>()); 84private static void AddOptionMapping(ConcurrentDictionary<string, ImmutableHashSet<IOption2>> map, string diagnosticId, ImmutableHashSet<IOption2> options) 88Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions));
src\Analyzers\Core\Analyzers\ParenthesesDiagnosticAnalyzersHelper.cs (1)
16internal static ImmutableHashSet<IOption2> Options =
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
36private readonly Lazy<ImmutableHashSet<int>> _lazySupportedCompilerErrorCodes; 41_lazySupportedCompilerErrorCodes = new Lazy<ImmutableHashSet<int>>(GetSupportedCompilerErrorCodes); 51private ImmutableHashSet<int> GetSupportedCompilerErrorCodes() 182var idsToAnalyze = idsToAnalyzeBuilder.ToImmutableHashSet(); 390ImmutableHashSet<string> idsToAnalyze,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
121private readonly ImmutableHashSet<INamedTypeSymbol?> _attributeSetForMethodsToIgnore;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (3)
26ImmutableHashSet<INamedTypeSymbol> attributeSetForMethodsToIgnore, 34private readonly ImmutableHashSet<INamedTypeSymbol> _attributeSetForMethodsToIgnore = attributeSetForMethodsToIgnore; 51var attributeSetForMethodsToIgnore = ImmutableHashSet.CreateRange(GetAttributesForMethodsToIgnore(context.Compilation).WhereNotNull());
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
26private static readonly ImmutableHashSet<string> s_nonEnumerableReturningLinqPredicateMethodNames = 37private static readonly ImmutableHashSet<string> s_nonEnumerableReturningLinqSelectorMethodNames =
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (10)
24private ImmutableHashSet<V>.Enumerator _values; 37var set = v._value as ImmutableHashSet<V>; 121var set = _value as ImmutableHashSet<V>; 134_equalityComparer = equalityComparer ?? ImmutableHashSet<V>.Empty.KeyComparer; 156var set = _value as ImmutableHashSet<V>; 172var set = _value as ImmutableHashSet<V>;
src\Dependencies\Collections\ImmutableSegmentedHashSet.cs (1)
81/// <inheritdoc cref="ImmutableHashSet.ToImmutableHashSet{TSource}(ImmutableHashSet{TSource}.Builder)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (24)
18/// best for <see cref="ImmutableHashSet{T}"/>.</para> 27/// <description><see cref="ImmutableHashSet{T}"/> Complexity</description> 66/// <inheritdoc cref="ImmutableHashSet{T}.Empty"/> 76/// <inheritdoc cref="ImmutableHashSet{T}.KeyComparer"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Count"/> 84/// <inheritdoc cref="ImmutableHashSet{T}.IsEmpty"/> 105/// <inheritdoc cref="ImmutableHashSet{T}.Add(T)"/> 128/// <inheritdoc cref="ImmutableHashSet{T}.Clear()"/> 141/// <inheritdoc cref="ImmutableHashSet{T}.Contains(T)"/> 145/// <inheritdoc cref="ImmutableHashSet{T}.Except(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.GetEnumerator()"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Intersect(IEnumerable{T})"/> 195/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSubsetOf(IEnumerable{T})"/> 199/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSupersetOf(IEnumerable{T})"/> 203/// <inheritdoc cref="ImmutableHashSet{T}.IsSubsetOf(IEnumerable{T})"/> 207/// <inheritdoc cref="ImmutableHashSet{T}.IsSupersetOf(IEnumerable{T})"/> 211/// <inheritdoc cref="ImmutableHashSet{T}.Overlaps(IEnumerable{T})"/> 215/// <inheritdoc cref="ImmutableHashSet{T}.Remove(T)"/> 233/// <inheritdoc cref="ImmutableHashSet{T}.SetEquals(IEnumerable{T})"/> 237/// <inheritdoc cref="ImmutableHashSet{T}.SymmetricExcept(IEnumerable{T})"/> 263/// <inheritdoc cref="ImmutableHashSet{T}.TryGetValue(T, out T)"/> 276/// <inheritdoc cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> 295/// <inheritdoc cref="ImmutableHashSet{T}.ToBuilder()"/> 302/// <inheritdoc cref="ImmutableHashSet{T}.WithComparer(IEqualityComparer{T}?)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (19)
24/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 31/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 36/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 40/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 44/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 48/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 63/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 67/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 71/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 75/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 87/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 91/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 95/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 99/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 103/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 107/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 111/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Enumerator.cs (5)
13/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator"/> 25/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Current"/> 30/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Dispose()"/> 34/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.MoveNext()"/> 38/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Reset()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (19)
35/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 53/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 74/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 100/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 104/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 165/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 169/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 181/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 185/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 189/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 193/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 202/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 206/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 210/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 223/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 261/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
20private static ImmutableHashSet<string> ReservedKeys { get; } 32private static ImmutableHashSet<string> ReservedValues { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (1)
244public static void AppendToAliasNameSet(this string? alias, ImmutableHashSet<string>.Builder builder)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
141public abstract bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (4)
75ImmutableHashSet<ILocalSymbol> capturedLocals, 114public ImmutableHashSet<ILocalSymbol> CapturedLocals { get; } 187private static ImmutableHashSet<ILocalSymbol> GetCapturedLocals(ControlFlowGraph cfg) 598public override bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (1)
80public override bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
508if (!_currentAnalysisData.TryGetDelegateInvocationTargets(operation, out var targets))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
16ImmutableHashSet<ISymbol> symbolsRead) 40public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
79ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (7)
100public static bool MultiAdd<TKey, TValue>(this IDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value, IEqualityComparer<TValue>? comparer = null) 103if (dictionary.TryGetValue(key, out var set)) 105var updated = set.Add(value); 158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value) 161if (dictionary.TryGetValue(key, out var collection)) 200public static void MultiRemove<TKey, TValue>(this IDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
91var projects = solution.Projects.ToImmutableHashSet();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Collections.Package (68)
ImmutableSegmentedHashSet.cs (1)
81/// <inheritdoc cref="ImmutableHashSet.ToImmutableHashSet{TSource}(ImmutableHashSet{TSource}.Builder)"/>
ImmutableSegmentedHashSet`1.cs (24)
18/// best for <see cref="ImmutableHashSet{T}"/>.</para> 27/// <description><see cref="ImmutableHashSet{T}"/> Complexity</description> 66/// <inheritdoc cref="ImmutableHashSet{T}.Empty"/> 76/// <inheritdoc cref="ImmutableHashSet{T}.KeyComparer"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Count"/> 84/// <inheritdoc cref="ImmutableHashSet{T}.IsEmpty"/> 105/// <inheritdoc cref="ImmutableHashSet{T}.Add(T)"/> 128/// <inheritdoc cref="ImmutableHashSet{T}.Clear()"/> 141/// <inheritdoc cref="ImmutableHashSet{T}.Contains(T)"/> 145/// <inheritdoc cref="ImmutableHashSet{T}.Except(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.GetEnumerator()"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Intersect(IEnumerable{T})"/> 195/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSubsetOf(IEnumerable{T})"/> 199/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSupersetOf(IEnumerable{T})"/> 203/// <inheritdoc cref="ImmutableHashSet{T}.IsSubsetOf(IEnumerable{T})"/> 207/// <inheritdoc cref="ImmutableHashSet{T}.IsSupersetOf(IEnumerable{T})"/> 211/// <inheritdoc cref="ImmutableHashSet{T}.Overlaps(IEnumerable{T})"/> 215/// <inheritdoc cref="ImmutableHashSet{T}.Remove(T)"/> 233/// <inheritdoc cref="ImmutableHashSet{T}.SetEquals(IEnumerable{T})"/> 237/// <inheritdoc cref="ImmutableHashSet{T}.SymmetricExcept(IEnumerable{T})"/> 263/// <inheritdoc cref="ImmutableHashSet{T}.TryGetValue(T, out T)"/> 276/// <inheritdoc cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> 295/// <inheritdoc cref="ImmutableHashSet{T}.ToBuilder()"/> 302/// <inheritdoc cref="ImmutableHashSet{T}.WithComparer(IEqualityComparer{T}?)"/>
ImmutableSegmentedHashSet`1+Builder.cs (19)
24/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 31/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 36/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 40/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 44/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 48/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 63/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 67/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 71/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 75/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 87/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 91/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 95/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 99/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 103/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 107/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 111/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
ImmutableSegmentedHashSet`1+Enumerator.cs (5)
13/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator"/> 25/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Current"/> 30/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Dispose()"/> 34/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.MoveNext()"/> 38/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Reset()"/>
ImmutableSegmentedHashSet`1+ValueBuilder.cs (19)
35/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 53/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 74/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 100/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 104/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 165/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 169/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 181/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 185/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 189/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 193/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 202/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 206/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 210/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 223/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 261/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
Microsoft.CodeAnalysis.CSharp (129)
Binder\Binder_Statements.cs (1)
32internal virtual ImmutableHashSet<Symbol> LockedOrDisposedVariables
Binder\BuckStopsHereBinder.cs (1)
252internal override ImmutableHashSet<Symbol> LockedOrDisposedVariables
Binder\LockOrUsingBinder.cs (3)
21private ImmutableHashSet<Symbol> _lazyLockedOrDisposedVariables; 31internal sealed override ImmutableHashSet<Symbol> LockedOrDisposedVariables 37ImmutableHashSet<Symbol> lockedOrDisposedVariables = this.Next.LockedOrDisposedVariables;
Binder\Semantics\OverloadResolution\CallingConventionInfo.cs (2)
13internal readonly ImmutableHashSet<CustomModifier>? UnmanagedCallingConventionTypes; 15public CallingConventionInfo(Cci.CallingConvention callKind, ImmutableHashSet<CustomModifier> unmanagedCallingConventionTypes)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (7)
698ImmutableHashSet<INamedTypeSymbolInternal> actualUnmanagedCallingConventionTypes; 703actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 723actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 730actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 734actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 738actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty; 742actualUnmanagedCallingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty;
Binder\SwitchBinder_Patterns.cs (2)
77var reachableLabels = decisionDag.ReachableLabels; 78static bool isSubsumed(BoundSwitchLabel switchLabel, ImmutableHashSet<LabelSymbol> reachableLabels)
Binder\SwitchExpressionBinder.cs (1)
64var reachableLabels = decisionDag.ReachableLabels;
BoundTree\BoundDecisionDag.cs (2)
21private ImmutableHashSet<LabelSymbol> _reachableLabels; 46public ImmutableHashSet<LabelSymbol> ReachableLabels
Compilation\CSharpCompilation.cs (7)
143private ImmutableHashSet<SyntaxTree>? _usageOfUsingsRecordedInTrees = ImmutableHashSet<SyntaxTree>.Empty; 145internal ImmutableHashSet<SyntaxTree>? UsageOfUsingsRecordedInTrees => Volatile.Read(ref _usageOfUsingsRecordedInTrees); 3142var trackingSet = UsageOfUsingsRecordedInTrees; 3185var current = UsageOfUsingsRecordedInTrees; 3194var updated = current.Add(tree); 3207var recent = Interlocked.CompareExchange(ref _usageOfUsingsRecordedInTrees, updated, current);
Errors\ErrorFacts.cs (2)
22public static readonly ImmutableHashSet<string> NullableWarnings; 26ImmutableHashSet<string>.Builder nullableWarnings = ImmutableHashSet.CreateBuilder<string>();
FlowAnalysis\AbstractFlowPass.cs (1)
961var reachableLabels = node.ReachabilityDecisionDag.ReachableLabels;
FlowAnalysis\AbstractFlowPass_Switch.cs (2)
46var reachableLabels = node.ReachabilityDecisionDag.ReachableLabels; 160var reachableLabels = node.ReachabilityDecisionDag.ReachableLabels;
FlowAnalysis\NullableWalker.cs (3)
1352private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 6915ImmutableHashSet<string>? returnNotNullIfParameterNotNull = IsAnalyzingAttribute ? null : method?.ReturnNotNullIfParameterNotNull; 7644var notNullIfParameterNotNull = parameter.NotNullIfParameterNotNull;
Lowering\ClosureConversion\ClosureConversion.cs (1)
152private readonly ImmutableHashSet<Symbol> _allCapturedVariables;
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
152public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
210public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => BaseMethod.ReturnNotNullIfParameterNotNull;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
106public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Attributes\WellKnownAttributeData\ParameterWellKnownAttributeData.cs (3)
145private ImmutableHashSet<string> _notNullIfParameterNotNull = ImmutableHashSet<string>.Empty; 146public ImmutableHashSet<string> NotNullIfParameterNotNull
Symbols\Attributes\WellKnownAttributeData\ReturnTypeWellKnownAttributeData.cs (3)
46private ImmutableHashSet<string> _notNullIfParameterNotNull = ImmutableHashSet<string>.Empty; 47public ImmutableHashSet<string> NotNullIfParameterNotNull
Symbols\ErrorMethodSymbol.cs (2)
175public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (6)
21private ImmutableHashSet<CustomModifier>? _lazyCallingConventionModifiers; 667public ImmutableHashSet<CustomModifier> GetCallingConventionModifiers() 674_lazyCallingConventionModifiers = ImmutableHashSet<CustomModifier>.Empty; 689_lazyCallingConventionModifiers = ImmutableHashSet<CustomModifier>.Empty; 846public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
88internal override ImmutableHashSet<string> NotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
668public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => Signature.ReturnParam.NotNullIfParameterNotNull;
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
913internal override ImmutableHashSet<string> NotNullIfParameterNotNull
Symbols\MethodSymbol.cs (4)
251public abstract ImmutableHashSet<string> ReturnNotNullIfParameterNotNull { get; } 989internal static (bool IsCallConvs, ImmutableHashSet<INamedTypeSymbolInternal>? CallConvs) TryDecodeUnmanagedCallersOnlyCallConvsField( 996ImmutableHashSet<INamedTypeSymbolInternal>? callingConventionTypes = null; 1005callingConventionTypes = ImmutableHashSet<INamedTypeSymbolInternal>.Empty;
Symbols\ParameterSymbol.cs (1)
404internal abstract ImmutableHashSet<string> NotNullIfParameterNotNull { get; }
Symbols\ReducedExtensionMethodSymbol.cs (1)
499public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => _reducedFrom.ReturnNotNullIfParameterNotNull;
Symbols\SignatureOnlyMethodSymbol.cs (2)
81public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\SignatureOnlyParameterSymbol.cs (1)
91internal override ImmutableHashSet<string> NotNullIfParameterNotNull { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\Source\ConstantEvaluationHelpers.cs (5)
88public ImmutableHashSet<T> Dependencies; 93public ImmutableHashSet<T> DependedOnBy; 124node.DependedOnBy = ImmutableHashSet<SourceFieldSymbolWithSyntaxReference>.Empty; 127var dependencies = field.GetConstantValueDependencies(earlyDecodingWellKnownAttributes); 144node.DependedOnBy = ImmutableHashSet<SourceFieldSymbolWithSyntaxReference>.Empty;
Symbols\Source\SourceClonedParameterSymbol.cs (2)
148internal override ImmutableHashSet<string> NotNullIfParameterNotNull 150get { return ImmutableHashSet<string>.Empty; }
Symbols\Source\SourceComplexParameterSymbol.cs (2)
193internal override ImmutableHashSet<string> NotNullIfParameterNotNull 194=> GetDecodedWellKnownAttributeData()?.NotNullIfParameterNotNull ?? ImmutableHashSet<string>.Empty;
Symbols\Source\SourceFieldSymbol.cs (5)
280internal ImmutableHashSet<SourceFieldSymbolWithSyntaxReference> GetConstantValueDependencies(bool earlyDecodingWellKnownAttributes) 288return ImmutableHashSet<SourceFieldSymbolWithSyntaxReference>.Empty; 291ImmutableHashSet<SourceFieldSymbolWithSyntaxReference> dependencies; 310dependencies = ImmutableHashSet<SourceFieldSymbolWithSyntaxReference>.Empty; 314dependencies = ImmutableHashSet<SourceFieldSymbolWithSyntaxReference>.Empty.Union(builder);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1324TypeWithAnnotations getNotNullIfNotNullOutputType(TypeWithAnnotations outputType, ImmutableHashSet<string> notNullIfParameterNotNull)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
112public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull 113=> GetDecodedReturnTypeWellKnownAttributeData()?.NotNullIfParameterNotNull ?? ImmutableHashSet<string>.Empty; 1436ImmutableHashSet<CodeAnalysis.Symbols.INamedTypeSymbolInternal>? callingConventionTypes = null;
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
376public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
132internal override ImmutableHashSet<string> NotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Source\ThisParameterSymbol.cs (2)
78internal sealed override ImmutableHashSet<string> NotNullIfParameterNotNull 80get { return ImmutableHashSet<string>.Empty; }
Symbols\Symbol.cs (1)
1154var secondaryDependencies = result.SecondaryDependencies;
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (2)
53internal override ImmutableHashSet<string> NotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
169public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
147public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (2)
122public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
108public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
161public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
151public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
234public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedParameterSymbol.cs (3)
125internal override ImmutableHashSet<string> NotNullIfParameterNotNull 127get { return ImmutableHashSet<string>.Empty; } 423internal override ImmutableHashSet<string> NotNullIfParameterNotNull
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
199public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
165public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
145public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
Symbols\TypeSymbol.cs (5)
42private ImmutableHashSet<Symbol> _lazyAbstractMembers; 2373internal ImmutableHashSet<Symbol> AbstractMembers 2385private ImmutableHashSet<Symbol> ComputeAbstractMembers() 2387var abstractMembers = ImmutableHashSet.Create<Symbol>(); 2388var overriddenMembers = ImmutableHashSet.Create<Symbol>();
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
324public sealed override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => UnderlyingMethod.ReturnNotNullIfParameterNotNull;
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
150internal override ImmutableHashSet<string> NotNullIfParameterNotNull
Utilities\ValueSetFactory.EnumeratedValueSet.cs (5)
30private readonly ImmutableHashSet<T> _membersIncludedOrExcluded; 34private EnumeratedValueSet(bool included, ImmutableHashSet<T> membersIncludedOrExcluded, IEquatableValueTC<T> tc) => 38=> new EnumeratedValueSet<T>(included: false, ImmutableHashSet<T>.Empty, tc); 41=> new EnumeratedValueSet<T>(included: true, ImmutableHashSet<T>.Empty, tc); 44=> new EnumeratedValueSet<T>(included: true, ImmutableHashSet<T>.Empty.Add(value), tc);
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
58nameof(ImmutableHashSet<int>),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
41public static readonly ImmutableHashSet<string?> BannedTypes = [
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (3)
128public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 145private static void AppendAliasNames(SyntaxList<UsingDirectiveSyntax> usings, ImmutableHashSet<string>.Builder builder) 158private static void AppendAliasNames(IEnumerable<BaseNamespaceDeclarationSyntax> namespaces, ImmutableHashSet<string>.Builder builder, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
50var documentImmutableSet = ImmutableHashSet.Create(document);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (2)
src\Analyzers\CSharp\Tests\AbstractBuiltInCodeStyleDiagnosticAnalyzer\AbstractBuiltInCodeStyleDiagnosticAnalyzerTests.cs (2)
35private static ImmutableArray<(DiagnosticDescriptor, ImmutableHashSet<IOption2>)> CreateSupportedDiagnosticsWithOptionsFromIds(IEnumerable<string> ids) 37var builder = ImmutableArray.CreateBuilder<(DiagnosticDescriptor, ImmutableHashSet<IOption2>)>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (11)
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
450var provider = Assert.IsType<CrefCompletionProvider>(service.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet<string>.Empty).Single());
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.cs (1)
1532var provider = Assert.Single(service.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet<string>.Empty));
NavigateTo\NavigateToSearcherTests.cs (9)
43ImmutableHashSet<string>.Empty, 66ImmutableHashSet<string>.Empty, 93ImmutableHashSet<string>.Empty, 146kinds: ImmutableHashSet<string>.Empty, 186kinds: ImmutableHashSet<string>.Empty, 223kinds: ImmutableHashSet<string>.Empty, 260kinds: ImmutableHashSet<string>.Empty, 291kinds: ImmutableHashSet<string>.Empty, 349kinds: ImmutableHashSet<string>.Empty,
Microsoft.CodeAnalysis.CSharp.Features (37)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (1)
49public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
32public override ImmutableHashSet<char> TriggerCharacters => CompletionUtilities.CommonTriggerCharactersWithArgumentList;
Completion\CompletionProviders\CompletionUtilities.cs (3)
115internal static ImmutableHashSet<char> CommonTriggerCharacters { get; } = ['.', '#', '>', ':']; 117internal static ImmutableHashSet<char> CommonTriggerCharactersWithArgumentList { get; } = ['.', '#', '>', ':', '(', '[', ' ']; 136internal static ImmutableHashSet<char> SpaceTriggerCharacter => [' '];
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
56public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
38public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
300var currentParameterNames = baseMethod.ParameterList.Parameters.Select(p => p.Identifier.ValueText).ToImmutableHashSet();
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
36private static readonly ImmutableHashSet<char> s_triggerCharacters = [' ', '[', '(', '~']; 59public override ImmutableHashSet<char> TriggerCharacters => s_triggerCharacters;
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
35public override ImmutableHashSet<char> TriggerCharacters { get; } = ['.'];
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
36public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
37public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
39public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
36public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
36public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\KeywordCompletionProvider.cs (1)
184public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters.Add(' ');
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
51public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
100public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters.Add(' ');
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
39public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
63public override ImmutableHashSet<char> TriggerCharacters => ['.'];
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
42public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
80public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
55public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Completion\CompletionProviders\PreprocessorCompletionProvider.cs (1)
31public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
168public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters.Add(' ');
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
70public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
38public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharacters;
Completion\CompletionProviders\SymbolCompletionProvider.cs (1)
70public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.CommonTriggerCharactersWithArgumentList;
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
123public override ImmutableHashSet<char> TriggerCharacters => [];
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
66public override ImmutableHashSet<char> TriggerCharacters { get; } = ['<', '"', ' '];
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
108var initializedFieldsAndProperties = await GetExistingAssignedFieldsOrPropertiesAsync().ConfigureAwait(false); 211async Task<ImmutableHashSet<(ISymbol fieldOrProperty, EqualsValueClauseSyntax initializer)>> GetExistingAssignedFieldsOrPropertiesAsync()
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
22private static readonly ImmutableHashSet<string> s_predefinedTypeMetadataNames =
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
58nameof(ImmutableHashSet<int>),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
41public static readonly ImmutableHashSet<string?> BannedTypes = [
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
50var documentImmutableSet = ImmutableHashSet.Create(document);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
src\Analyzers\CSharp\Tests\AbstractBuiltInCodeStyleDiagnosticAnalyzer\AbstractBuiltInCodeStyleDiagnosticAnalyzerTests.cs (2)
35private static ImmutableArray<(DiagnosticDescriptor, ImmutableHashSet<IOption2>)> CreateSupportedDiagnosticsWithOptionsFromIds(IEnumerable<string> ids) 37var builder = ImmutableArray.CreateBuilder<(DiagnosticDescriptor, ImmutableHashSet<IOption2>)>();
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (1)
57private readonly ImmutableHashSet<TextSpan> _conflictLocations;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (3)
128public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 145private static void AppendAliasNames(SyntaxList<UsingDirectiveSyntax> usings, ImmutableHashSet<string>.Builder builder) 158private static void AppendAliasNames(IEnumerable<BaseNamespaceDeclarationSyntax> namespaces, ImmutableHashSet<string>.Builder builder, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures (4)
IntelliSense\AsyncCompletion\CompletionSource.cs (1)
60private readonly ImmutableHashSet<string> _roles;
ReferenceHighlighting\ReferenceHighlightingViewTaggerProvider.cs (1)
159var documentsToSearch = documentsToSearchBuilder.ToImmutable();
Workspaces\AbstractTextBufferVisibilityTracker.cs (2)
143/// <see cref="ImmutableHashSet{T}"/> so we can enumerate it safely without it changing underneath us. 145public ImmutableHashSet<Action> Callbacks { get; private set; } = [];
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (5)
Completion\AbstractCompletionProviderTests.cs (3)
105var completionProviders = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet<string>.Empty); 112internal static ImmutableHashSet<string> GetRoles(Document document) 113=> document.SourceCodeKind == SourceCodeKind.Regular ? ImmutableHashSet<string>.Empty : ImmutableHashSet.Create(PredefinedInteractiveTextViewRoles.InteractiveTextViewRole);
Diagnostics\MockDiagnosticAnalyzerService.cs (2)
64public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 70public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeActions\CodeChangeProviderMetadataTests.cs (5)
91var predefinedNames = GetPredefinedNamesFromType(predefinedNamesType); 118var predefinedNames = GetPredefinedNamesFromType(predefinedNamesType); 122var providerNames = exportedProviders 130var unusedPredefinedNames = predefinedNames.Except(providerNames); 152private static ImmutableHashSet<string> GetPredefinedNamesFromType(Type namesType)
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (4)
25private static ImmutableArray<(string diagnosticId, ImmutableHashSet<IOption2> codeStyleOptions)> GetIDEDiagnosticIdsAndOptions( 28var diagnosticIdAndOptions = new List<(string diagnosticId, ImmutableHashSet<IOption2> options)>(); 48if (!IDEDiagnosticIdToOptionMappingHelper.TryGetMappedOptions(diagnosticId, languageName, out var options)) 50options = ImmutableHashSet<IOption2>.Empty;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
NavigateTo\NavigateToItemProvider.cs (1)
46public ImmutableHashSet<string> KindsProvided
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (26)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (21)
4242Dim slowProvider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of SlowProvider)().Single() 5131Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of BooleanTaskControlledCompletionProvider)().Single() 5182Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of BooleanTaskControlledCompletionProvider)().Single() 5258Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of BooleanTaskControlledCompletionProvider)().Single() 5327Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of BooleanTaskControlledCompletionProvider)().Single() 5844Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of MultipleChangeCompletionProvider)().Single() 5912Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of MultipleChangeCompletionProvider)().Single() 6644Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 6669Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 6699Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 6728Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 6753Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockWeirdProvider)().Single() 6778Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockWeirdProvider)().Single() 6805Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 6855Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of IntelliCodeMockProvider)().Single() 9538Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TestMatchPriorityCompletionProvider)().Single() 9570Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TestMatchPriorityCompletionProvider)().Single() 10295Dim notifyProvider As NotifyCommittingItemCompletionProvider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of NotifyCommittingItemCompletionProvider)().Single() 10378Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TestProvider)().Single() 10433Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TestProvider)().Single() 10487Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TestProvider)().Single()
IntelliSense\CSharpCompletionCommandHandlerTests_DefaultsSource.vb (2)
667Optional roles As ImmutableHashSet(Of String) = Nothing, 693Optional roles As ImmutableHashSet(Of String) = Nothing) As Boolean
IntelliSense\VisualBasicCompletionCommandHandlerTests.vb (3)
407Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single() 445Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single() 479Dim provider = completionService.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet(Of String).Empty).OfType(Of TriggeredCompletionProvider)().Single()
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (2)
VisualBasic\Keywords.cs (1)
16private static ImmutableHashSet<string> GetKeywords(StringComparer comparer)
VisualBasic\MemberSignatureParser.cs (1)
17internal static readonly ImmutableHashSet<string> Keywords = GetKeywords(StringComparer);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (2)
VisualBasicParsingTests.cs (2)
36var actualKeywordKinds = builder.ToImmutable(); 37var expectedKeywordKinds = ImmutableHashSet.CreateRange(SyntaxFacts.GetReservedKeywordKinds());
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
VS\IFSharpWorkspaceProjectContextFactory.cs (1)
103private ImmutableHashSet<string> _metadataReferences;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (3)
Completion\OmniSharpCompletionService.cs (2)
20ImmutableHashSet<string>? roles, 33ImmutableHashSet<string>? roles,
Rename\OmniSharpRenamer.cs (1)
25ImmutableHashSet<ISymbol>? nonConflictSymbols,
Microsoft.CodeAnalysis.Features (83)
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
385if (IDEDiagnosticIdToOptionMappingHelper.TryGetMappedOptions(diagnostic.Id, project.Language, out var options))
Completion\CommonCompletionUtilities.cs (1)
229internal static ImmutableHashSet<char> GetTriggerCharacters(CompletionProvider provider)
Completion\CompletionContext.cs (1)
59/// be overwritten during <see cref="CompletionService.GetCompletionsAsync(Document, int, CompletionTrigger, ImmutableHashSet{string}, OptionSet, CancellationToken)"/>.
Completion\CompletionService.cs (3)
98ImmutableHashSet<string>? roles = null, 139ImmutableHashSet<string>? roles = null) 403public ImmutableArray<CompletionProvider> GetImportedAndBuiltInProviders(ImmutableHashSet<string> roles)
Completion\CompletionService.ProviderManager.cs (12)
25private sealed class ProviderManager : IEqualityComparer<ImmutableHashSet<string>> 29private readonly Dictionary<ImmutableHashSet<string>, ImmutableArray<CompletionProvider>> _rolesToProviders; 38_rolesToProviders = new Dictionary<ImmutableHashSet<string>, ImmutableArray<CompletionProvider>>(this); 120private ImmutableArray<CompletionProvider> GetImportedAndBuiltInProviders(ImmutableHashSet<string>? roles) 135ImmutableArray<CompletionProvider> GetImportedAndBuiltInProvidersWorker(ImmutableHashSet<string> roles) 167Project? project, ImmutableHashSet<string>? roles, CompletionTrigger trigger, in CompletionOptions options) 222bool IEqualityComparer<ImmutableHashSet<string>>.Equals([AllowNull] ImmutableHashSet<string> x, [AllowNull] ImmutableHashSet<string> y) 245int IEqualityComparer<ImmutableHashSet<string>>.GetHashCode([DisallowNull] ImmutableHashSet<string> obj) 283public ImmutableArray<CompletionProvider> GetImportedAndBuiltInProviders(ImmutableHashSet<string> roles)
Completion\CompletionService_GetCompletions.cs (3)
41ImmutableHashSet<string>? roles = null, 68ImmutableHashSet<string>? roles = null, 130Document document, ConcatImmutableArray<CompletionProvider> providers, int caretPosition, CompletionOptions options, CompletionTrigger trigger, ImmutableHashSet<string>? roles, SourceText text)
Completion\LSPCompletionProvider.cs (1)
15public abstract ImmutableHashSet<char> TriggerCharacters { get; }
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (2)
44private static ImmutableHashSet<char> GetTriggerCharactersForEmbeddedLanguage(IEmbeddedLanguage language) 71public override ImmutableHashSet<char> TriggerCharacters { get; }
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
53public override ImmutableHashSet<char> TriggerCharacters { get; } = ['\"']; 180var resultBuilder = (ImmutableHashSet<string>.Builder?)null;
Completion\Providers\AbstractSuggestionModeCompletionProvider.cs (1)
25public override ImmutableHashSet<char> TriggerCharacters => [];
Completion\Providers\EmbeddedLanguageCompletionProvider.cs (1)
21public abstract ImmutableHashSet<char> TriggerCharacters { get; }
Diagnostics\IDiagnosticAnalyzerService.cs (4)
58/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId?, ImmutableHashSet{string}?, Func{DiagnosticAnalyzer, bool}?, bool, bool, CancellationToken)"/> 79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 98Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
EditAndContinue\DebuggingSession.cs (1)
872public ImmutableHashSet<Guid> GetModulesPreparedForUpdate()
EditAndContinue\EditSession.cs (2)
655MergePartialEdits(oldCompilation, newCompilation, allEdits, out var mergedEdits, out var addedSymbols, cancellationToken); 675out ImmutableHashSet<ISymbol> addedSymbols,
EditAndContinue\ProjectChanges.cs (2)
27public readonly ImmutableHashSet<ISymbol> AddedSymbols; 42ImmutableHashSet<ISymbol> addedSymbols,
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
34public override ImmutableHashSet<char> TriggerCharacters { get; } = ['"', ':'];
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (1)
41public override ImmutableHashSet<char> TriggerCharacters { get; } = ['\\', '[', '(', '{']; // \p{
ExternalAccess\UnitTesting\API\UnitTestingInvocationReasons.cs (4)
13internal partial struct UnitTestingInvocationReasons(ImmutableHashSet<string> reasons) : IEnumerable<string> 15public static readonly UnitTestingInvocationReasons Empty = new(ImmutableHashSet<string>.Empty); 18private readonly ImmutableHashSet<string> _reasons = reasons ?? []; 36public ImmutableHashSet<string>.Enumerator GetEnumerator()
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (6)
38public readonly ImmutableHashSet<IUnitTestingIncrementalAnalyzer> SpecificAnalyzers; 62ImmutableHashSet<IUnitTestingIncrementalAnalyzer> specificAnalyzers, 96private ImmutableHashSet<IUnitTestingIncrementalAnalyzer> Union(ImmutableHashSet<IUnitTestingIncrementalAnalyzer> analyzers) 120ImmutableHashSet<IUnitTestingIncrementalAnalyzer> analyzers, bool retry, IAsyncToken asyncToken) 159public UnitTestingWorkItem With(ImmutableHashSet<IUnitTestingIncrementalAnalyzer> specificAnalyzers, IAsyncToken asyncToken)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
30public IImmutableSet<string> KindsProvided => _searchService?.KindsProvided ?? ImmutableHashSet<string>.Empty;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (3)
297.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken) 361var localSymbolsInCallee = LocalVariableDeclarationVisitor 389public static ImmutableHashSet<ISymbol> GetAllSymbols(
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
442.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false);
NavigateTo\NavigateToSearcher.cs (1)
526=> ImmutableHashSet<string>.Empty;
NavigateTo\NavigateToUtilities.cs (1)
16public static ImmutableHashSet<string> GetKindsProvided(Solution solution)
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
69var documentsToBeSearched = ImmutableHashSet.Create(document);
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (3)
67ImmutableHashSet<IOption2> options, 96protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions) 116private static void AddDiagnosticIdToOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options)
src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
73ImmutableHashSet<IOption2> options, 112protected AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions, PerLanguageOption2<bool>? fadingOption)
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (8)
23private static readonly ConcurrentDictionary<string, ImmutableHashSet<IOption2>> s_diagnosticIdToOptionMap = new(); 24private static readonly ConcurrentDictionary<string, ConcurrentDictionary<string, ImmutableHashSet<IOption2>>> s_diagnosticIdToLanguageSpecificOptionsMap = new(); 27public static bool TryGetMappedOptions(string diagnosticId, string language, [NotNullWhen(true)] out ImmutableHashSet<IOption2>? options) 39public static void AddOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options) 71var map = s_diagnosticIdToLanguageSpecificOptionsMap.GetOrAdd(language, _ => new ConcurrentDictionary<string, ImmutableHashSet<IOption2>>()); 84private static void AddOptionMapping(ConcurrentDictionary<string, ImmutableHashSet<IOption2>> map, string diagnosticId, ImmutableHashSet<IOption2> options) 88Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions));
src\Analyzers\Core\Analyzers\ParenthesesDiagnosticAnalyzersHelper.cs (1)
16internal static ImmutableHashSet<IOption2> Options =
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
36private readonly Lazy<ImmutableHashSet<int>> _lazySupportedCompilerErrorCodes; 41_lazySupportedCompilerErrorCodes = new Lazy<ImmutableHashSet<int>>(GetSupportedCompilerErrorCodes); 51private ImmutableHashSet<int> GetSupportedCompilerErrorCodes() 390ImmutableHashSet<string> idsToAnalyze,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
121private readonly ImmutableHashSet<INamedTypeSymbol?> _attributeSetForMethodsToIgnore;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
26ImmutableHashSet<INamedTypeSymbol> attributeSetForMethodsToIgnore, 34private readonly ImmutableHashSet<INamedTypeSymbol> _attributeSetForMethodsToIgnore = attributeSetForMethodsToIgnore;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
26private static readonly ImmutableHashSet<string> s_nonEnumerableReturningLinqPredicateMethodNames = 37private static readonly ImmutableHashSet<string> s_nonEnumerableReturningLinqSelectorMethodNames =
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
91var projects = solution.Projects.ToImmutableHashSet();
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (2)
47var autoReferences = projectAssets.Project?.Frameworks?.Values 72ImmutableHashSet<string> autoReferences,
Microsoft.CodeAnalysis.Features.UnitTests (6)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (6)
168var runningProjects = new[] { a, b }.ToImmutableHashSet(); 194var runningProjects = new[] { a, b }.ToImmutableHashSet(); 223var runningProjects = new[] { a }.ToImmutableHashSet(); 249var runningProjects = new[] { a, b }.ToImmutableHashSet(); 279var runningProjects = new[] { a, b }.ToImmutableHashSet(); 313var runningProjects = new[] { r1, r2, r3, r4 }.ToImmutableHashSet();
Microsoft.CodeAnalysis.LanguageServer.Protocol (21)
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (2)
22private readonly ImmutableHashSet<string>? _diagnosticIds; 25public FixAllDiagnosticProvider(IDiagnosticAnalyzerService diagnosticService, ImmutableHashSet<string> diagnosticIds)
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
114Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 121Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (3)
247(result, var failedDocuments) = await UpdateWithDocumentLoadAndGeneratorFailuresAsync(result, project, version, cancellationToken).ConfigureAwait(false); 296private async Task<(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, ImmutableHashSet<Document>? failedDocuments)> UpdateWithDocumentLoadAndGeneratorFailuresAsync( 302ImmutableHashSet<Document>.Builder? failedDocuments = null;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (3)
45public ImmutableHashSet<DocumentId> GetDocumentsWithDiagnostics() 457private readonly ImmutableHashSet<DocumentId>? _documentIds; 464public Builder(Project project, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds = null)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (6)
38var referenceIdsToRedirect = GetReferenceIdsToRedirectAsProjectAnalyzers(project); 42static HostAnalyzerStateSets CreateLanguageSpecificAnalyzerMap(HostAnalyzerStateSetKey arg, (HostDiagnosticAnalyzers HostAnalyzers, ImmutableHashSet<object> ReferenceIdsToRedirect) state) 55ImmutableHashSet<object> referenceIdsToRedirectAsProjectAnalyzers) 81private static ImmutableHashSet<object> GetReferenceIdsToRedirectAsProjectAnalyzers(Project project) 93static ImmutableHashSet<object> GetFeaturesAnalyzerReferenceIds(HostDiagnosticAnalyzers hostAnalyzers) 135public HostAnalyzerStateSets WithExcludedAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (4)
21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 24public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 207ImmutableHashSet<string>? diagnosticIds, 215private readonly ImmutableHashSet<string>? _diagnosticIds = diagnosticIds;
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
42public static ImmutableHashSet<string> BuiltInSnippets =
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Completion\CompletionFeaturesTests.cs (4)
584CodeAnalysis.Completion.CompletionOptions options, OptionSet passThroughOptions, ImmutableHashSet<string> roles = null) 595CompletionTrigger trigger = default, ImmutableHashSet<string> roles = null, CancellationToken cancellationToken = default) 877CodeAnalysis.Completion.CompletionOptions options, OptionSet passThroughOptions, ImmutableHashSet<string> roles = null) 888CompletionTrigger trigger = default, ImmutableHashSet<string> roles = null, CancellationToken cancellationToken = default)
Completion\CompletionResolveTests.cs (2)
494ImmutableHashSet<string> roles = null, 511internal override bool ShouldTriggerCompletion(Project project, LanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CodeAnalysis.Completion.CompletionOptions options, OptionSet passthroughOptions, ImmutableHashSet<string> roles = null)
Microsoft.CodeAnalysis.Remote.ServiceHub (4)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (4)
52private static ImmutableHashSet<Task> s_highPriorityComputeTasks = []; 65private static ImmutableHashSet<CancellationTokenSource> s_normalPriorityCancellationTokenSources = []; 206ImmutableHashSet<CancellationTokenSource> cancellationTokenSources; 290ImmutableHashSet<Task> highPriorityTasksToAwait;
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
384params (string DescriptorId, int DescriptorIndex, ImmutableHashSet<ReportDiagnostic> EffectiveSeverities)[] overriddenEffectiveSeveritiesWithIndex) 1118private readonly ImmutableHashSet<string> _symbolNames;
Microsoft.CodeAnalysis.UnitTests (3)
Collections\ImmutableSetTest.nonnetstandard.cs (2)
67System.Collections.Immutable.ImmutableHashSet<T> => null, 83System.Collections.Immutable.ImmutableHashSet<T> s => s.KeyComparer,
InternalUtilities\SpecializedCollectionsTests.cs (1)
24? ImmutableHashSet<int>.Empty
Microsoft.CodeAnalysis.VisualBasic (25)
Binding\Binder_Lookup.vb (3)
1423Public ReadOnly DescendantDefinitions As ImmutableHashSet(Of NamedTypeSymbol) 1425Public Sub New(interfaceType As NamedTypeSymbol, inComInterfaceContext As Boolean, Optional descendantDefinitions As ImmutableHashSet(Of NamedTypeSymbol) = Nothing) 1879Dim descendants As ImmutableHashSet(Of NamedTypeSymbol)
Declarations\DeclarationTreeBuilder.vb (10)
115Private Function CreateImplicitClass(parent As VisualBasicSyntaxNode, memberNames As ImmutableHashSet(Of String), children As ImmutableArray(Of SingleTypeDeclaration), declFlags As SingleTypeDeclaration.TypeDeclarationFlags) As SingleNamespaceOrTypeDeclaration 131Private Function CreateScriptClass(parent As VisualBasicSyntaxNode, children As ImmutableArray(Of SingleTypeDeclaration), memberNames As ImmutableHashSet(Of String), declFlags As SingleTypeDeclaration.TypeDeclarationFlags) As SingleNamespaceOrTypeDeclaration 604Private Shared ReadOnly s_memberNameBuilderPool As New ObjectPool(Of ImmutableHashSet(Of String).Builder)( 607Private Shared Function ToImmutableAndFree(builder As ImmutableHashSet(Of String).Builder) As ImmutableHashSet(Of String) 614Private Function GetNonTypeMemberNames(members As SyntaxList(Of StatementSyntax), ByRef declFlags As SingleTypeDeclaration.TypeDeclarationFlags) As ImmutableHashSet(Of String) 707Private Function GetMemberNames(enumBlockSyntax As EnumBlockSyntax, ByRef declFlags As SingleTypeDeclaration.TypeDeclarationFlags) As ImmutableHashSet(Of String) 736Private Sub AddMemberNames(methodDecl As MethodBaseSyntax, results As ImmutableHashSet(Of String).Builder) 757memberNames:=ImmutableHashSet(Of String).Empty, 783memberNames:=ImmutableHashSet(Of String).Empty,
Declarations\SingleTypeDeclaration.vb (2)
39memberNames As ImmutableHashSet(Of String), 103Public ReadOnly Property MemberNames As ImmutableHashSet(Of String)
Symbols\Source\SourceFieldSymbol.vb (10)
295Public Dependencies As ImmutableHashSet(Of SourceFieldSymbol) 300Public DependedOnBy As ImmutableHashSet(Of SourceFieldSymbol) 323node.DependedOnBy = ImmutableHashSet(Of SourceFieldSymbol).Empty 326Dim dependencies As ImmutableHashSet(Of SourceFieldSymbol) = field.GetConstantValueDependencies() 341node.DependedOnBy = ImmutableHashSet(Of SourceFieldSymbol).Empty 358Private Function GetConstantValueDependencies() As ImmutableHashSet(Of SourceFieldSymbol) 364Return ImmutableHashSet(Of SourceFieldSymbol).Empty 373Dim result As ImmutableHashSet(Of SourceFieldSymbol) 383result = ImmutableHashSet(Of SourceFieldSymbol).Empty 385result = ImmutableHashSet(Of SourceFieldSymbol).Empty.Union(builder)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
146Public Function GetAliasNameSet(model As SemanticModel, cancellationToken As CancellationToken) As ImmutableHashSet(Of String) Implements ISemanticFacts.GetAliasNameSet
Microsoft.CodeAnalysis.VisualBasic.Features (24)
Completion\CompletionProviders\AwaitCompletionProvider.vb (1)
29Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CommonTriggerChars
Completion\CompletionProviders\CompletionUtilities.vb (3)
18Friend ReadOnly CommonTriggerChars As ImmutableHashSet(Of Char) = ImmutableHashSet.Create("."c, "["c, "#"c, " "c, "="c, "<"c, "{"c) 20Friend ReadOnly CommonTriggerCharsAndParen As ImmutableHashSet(Of Char) = CommonTriggerChars.Add("("c) 22Friend ReadOnly SpaceTriggerChar As ImmutableHashSet(Of Char) = CommonTriggerChars.Add(" "c)
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
49Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerChars
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
88Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = ImmutableHashSet.Create(" "c, "("c, "="c)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (1)
74Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerChars
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
34Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerChars
Completion\CompletionProviders\ImportCompletionProvider\ExtensionMethodImportCompletionProvider.vb (1)
42Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CommonTriggerCharsAndParen
Completion\CompletionProviders\ImportCompletionProvider\TypeImportCompletionProvider.vb (1)
37Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CommonTriggerCharsAndParen
Completion\CompletionProviders\KeywordCompletionProvider.vb (1)
181Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerCharsAndParen
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (1)
42Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerChars
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (1)
38Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.SpaceTriggerChar
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
102Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = ImmutableHashSet.Create("."c)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
69Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.SpaceTriggerChar
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
55Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerChars
Completion\CompletionProviders\PreprocessorCompletionProvider.vb (1)
35Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CommonTriggerCharsAndParen
Completion\CompletionProviders\SymbolCompletionProvider.vb (1)
86Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = CompletionUtilities.CommonTriggerCharsAndParen
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (1)
56Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = ImmutableHashSet.Create("<"c, "/"c, """"c, " "c)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (5)
18Private Shared ReadOnly s_emptyAliasedNames As ImmutableHashSet(Of String) = ImmutableHashSet.Create(Of String)(CaseInsensitiveComparison.Comparer) 20Private Shared ReadOnly s_predefinedTypeMetadataNames As ImmutableHashSet(Of String) = ImmutableHashSet.Create( 54Private ReadOnly _aliasedNames As ImmutableHashSet(Of String) 90Private Shared Function GetAliasedNames(compilationUnit As CompilationUnitSyntax) As ImmutableHashSet(Of String) 110Private Shared Sub AddAliasedName(ByRef aliasedNames As ImmutableHashSet(Of String), simpleImportsClause As SimpleImportsClauseSyntax)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (3)
17Private ReadOnly _createAliasSet As Func(Of ImmutableHashSet(Of String)) = 44Private ReadOnly _aliasSet As Lazy(Of ImmutableHashSet(Of String)) 51Me._aliasSet = New Lazy(Of ImmutableHashSet(Of String))(_createAliasSet)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
46Private ReadOnly _conflictLocations As ImmutableHashSet(Of TextSpan)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
146Public Function GetAliasNameSet(model As SemanticModel, cancellationToken As CancellationToken) As ImmutableHashSet(Of String) Implements ISemanticFacts.GetAliasNameSet
Microsoft.CodeAnalysis.Workspaces (235)
CodeFixes\FixAllOccurrences\FixAllContext.cs (2)
57public ImmutableHashSet<string> DiagnosticIds => State.DiagnosticIds; 243ImmutableHashSet<string> diagnosticIds,
CodeFixes\FixAllOccurrences\FixAllState.cs (4)
22public ImmutableHashSet<string> DiagnosticIds { get; } 71var diagnosticIds = GetDiagnosticsIds(diagnosticsToFix.Values); 92var diagnosticIds = GetDiagnosticsIds(diagnosticsToFix.Values); 106private static ImmutableHashSet<string> GetDiagnosticsIds(IEnumerable<ImmutableArray<Diagnostic>> diagnosticsCollection)
Diagnostics\DiagnosticAnalysisResult.cs (6)
30public readonly ImmutableHashSet<DocumentId>? DocumentIds; 53private DiagnosticAnalysisResult(ProjectId projectId, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds, bool isEmpty, bool fromBuild) 74ImmutableHashSet<DocumentId>? documentIds, 164ImmutableHashSet<DocumentId>? documentIds) 200public ImmutableHashSet<DocumentId> DocumentIdsOrEmpty => DocumentIds ?? []; 292private static ImmutableHashSet<DocumentId> GetDocumentIds(
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
32public readonly ImmutableHashSet<DocumentId> DocumentIds => _lazyDocumentsWithDiagnostics == null ? [] : [.. _lazyDocumentsWithDiagnostics];
Diagnostics\SkippedHostAnalyzersInfo.cs (3)
29public ImmutableHashSet<DiagnosticAnalyzer> SkippedAnalyzers { get; } 40ImmutableHashSet<DiagnosticAnalyzer> skippedHostAnalyzers, 109var fullySkippedHostAnalyzers = fullySkippedHostAnalyzersBuilder.ToImmutable();
FindSymbols\FindReferences\FindReferenceCache.cs (2)
69private ImmutableHashSet<string>? _aliasNameSet; 100var set = semanticFacts.GetAliasNameSet(SemanticModel, cancellationToken);
FindSymbols\FindReferences\FindReferencesSearchEngine.BidirectionalSymbolSet.cs (1)
53var projects = ImmutableHashSet.Create(project);
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (2)
240ImmutableHashSet<Project> projects, CancellationToken cancellationToken) 275ImmutableHashSet<Project> projects,
FindSymbols\FindReferences\FindReferencesSearchEngine.UnidirectionalSymbolSet.cs (2)
35private readonly ImmutableHashSet<ISymbol> _upSymbols = upSymbols.ToImmutableHashSet(MetadataUnifyingEquivalenceComparer.Instance); 51var projects = ImmutableHashSet.Create(project);
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
60var projectsToSearch = documents.Select(d => d.Project).Where(p => p.SupportsCompilation).ToImmutableHashSet();
FindSymbols\IStreamingFindReferencesProgress.cs (1)
30public ImmutableHashSet<ISymbol> Symbols { get; }
Options\SolutionOptionSet.cs (2)
29private readonly ImmutableHashSet<OptionKey> _changedOptionKeys; 34ImmutableHashSet<OptionKey> changedOptionKeys)
Rename\ConflictEngine\ConflictResolver.Session.cs (8)
115var conflictLocations = ImmutableHashSet<ConflictLocationInfo>.Empty; 310ImmutableHashSet<ConflictLocationInfo> conflictLocations) 348var nonConflictSymbols = await GetNonConflictSymbolsAsync(currentProject).ConfigureAwait(false); 472private async Task<ImmutableHashSet<ISymbol>?> GetNonConflictSymbolsAsync(Project currentProject) 483ImmutableArray<ISymbol> symbols, ImmutableHashSet<ISymbol>? nonConflictSymbols) 703private async Task<(ImmutableHashSet<DocumentId> documentIds, ImmutableArray<string> possibleNameConflicts)> FindDocumentsAndPossibleNameConflictsAsync() 811var conflictLocationSpans = conflictLocations
Rename\RenameRewriterParameters.cs (2)
23ImmutableHashSet<TextSpan> conflictLocationSpans, 34internal readonly ImmutableHashSet<TextSpan> ConflictLocationSpans = conflictLocationSpans;
Rename\SymbolicRenameLocations.SearchResult.cs (2)
15public readonly ImmutableHashSet<RenameLocation> Locations; 20ImmutableHashSet<RenameLocation> locations,
SolutionCrawler\InvocationReasons.cs (4)
13internal partial struct InvocationReasons(ImmutableHashSet<string> reasons) : IEnumerable<string> 15public static readonly InvocationReasons Empty = new(ImmutableHashSet<string>.Empty); 18private readonly ImmutableHashSet<string> _reasons = reasons ?? []; 36public ImmutableHashSet<string>.Enumerator GetEnumerator()
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (3)
70private readonly Dictionary<string, ImmutableHashSet<string>> _knownAssemblyPathsBySimpleName = new(StringComparer.OrdinalIgnoreCase); 142if (!_knownAssemblyPathsBySimpleName.TryGetValue(simpleName, out var paths)) 308ImmutableHashSet<string>? paths;
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (10)
24private ImmutableHashSet<V>.Enumerator _values; 37var set = v._value as ImmutableHashSet<V>; 121var set = _value as ImmutableHashSet<V>; 134_equalityComparer = equalityComparer ?? ImmutableHashSet<V>.Empty.KeyComparer; 156var set = _value as ImmutableHashSet<V>; 172var set = _value as ImmutableHashSet<V>;
src\Dependencies\Collections\ImmutableSegmentedHashSet.cs (1)
81/// <inheritdoc cref="ImmutableHashSet.ToImmutableHashSet{TSource}(ImmutableHashSet{TSource}.Builder)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (24)
18/// best for <see cref="ImmutableHashSet{T}"/>.</para> 27/// <description><see cref="ImmutableHashSet{T}"/> Complexity</description> 66/// <inheritdoc cref="ImmutableHashSet{T}.Empty"/> 76/// <inheritdoc cref="ImmutableHashSet{T}.KeyComparer"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Count"/> 84/// <inheritdoc cref="ImmutableHashSet{T}.IsEmpty"/> 105/// <inheritdoc cref="ImmutableHashSet{T}.Add(T)"/> 128/// <inheritdoc cref="ImmutableHashSet{T}.Clear()"/> 141/// <inheritdoc cref="ImmutableHashSet{T}.Contains(T)"/> 145/// <inheritdoc cref="ImmutableHashSet{T}.Except(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.GetEnumerator()"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Intersect(IEnumerable{T})"/> 195/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSubsetOf(IEnumerable{T})"/> 199/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSupersetOf(IEnumerable{T})"/> 203/// <inheritdoc cref="ImmutableHashSet{T}.IsSubsetOf(IEnumerable{T})"/> 207/// <inheritdoc cref="ImmutableHashSet{T}.IsSupersetOf(IEnumerable{T})"/> 211/// <inheritdoc cref="ImmutableHashSet{T}.Overlaps(IEnumerable{T})"/> 215/// <inheritdoc cref="ImmutableHashSet{T}.Remove(T)"/> 233/// <inheritdoc cref="ImmutableHashSet{T}.SetEquals(IEnumerable{T})"/> 237/// <inheritdoc cref="ImmutableHashSet{T}.SymmetricExcept(IEnumerable{T})"/> 263/// <inheritdoc cref="ImmutableHashSet{T}.TryGetValue(T, out T)"/> 276/// <inheritdoc cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> 295/// <inheritdoc cref="ImmutableHashSet{T}.ToBuilder()"/> 302/// <inheritdoc cref="ImmutableHashSet{T}.WithComparer(IEqualityComparer{T}?)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (19)
24/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 31/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 36/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 40/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 44/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 48/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 63/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 67/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 71/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 75/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 87/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 91/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 95/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 99/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 103/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 107/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 111/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Enumerator.cs (5)
13/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator"/> 25/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Current"/> 30/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Dispose()"/> 34/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.MoveNext()"/> 38/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Reset()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (19)
35/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 53/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 74/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 100/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 104/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 165/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 169/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 181/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 185/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 189/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 193/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 202/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 206/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 210/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 223/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 261/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
20private static ImmutableHashSet<string> ReservedKeys { get; } 32private static ImmutableHashSet<string> ReservedValues { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (1)
244public static void AppendToAliasNameSet(this string? alias, ImmutableHashSet<string>.Builder builder)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (1)
141public abstract bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (4)
75ImmutableHashSet<ILocalSymbol> capturedLocals, 114public ImmutableHashSet<ILocalSymbol> CapturedLocals { get; } 187private static ImmutableHashSet<ILocalSymbol> GetCapturedLocals(ControlFlowGraph cfg) 598public override bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (1)
80public override bool TryGetDelegateInvocationTargets(IOperation write, out ImmutableHashSet<IOperation> targets)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
508if (!_currentAnalysisData.TryGetDelegateInvocationTargets(operation, out var targets))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageResult.cs (2)
16ImmutableHashSet<ISymbol> symbolsRead) 40public ImmutableHashSet<ISymbol> SymbolsRead { get; } = symbolsRead;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
79ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (7)
100public static bool MultiAdd<TKey, TValue>(this IDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value, IEqualityComparer<TValue>? comparer = null) 103if (dictionary.TryGetValue(key, out var set)) 105var updated = set.Add(value); 158public static ImmutableDictionary<TKey, ImmutableHashSet<TValue>> MultiRemove<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value) 161if (dictionary.TryGetValue(key, out var collection)) 200public static void MultiRemove<TKey, TValue>(this IDictionary<TKey, ImmutableHashSet<TValue>> dictionary, TKey key, TValue value)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
58public ImmutableHashSet<DocumentId> DocumentsNotFromFiles { get; private set; } = [];
Workspace\Solution\ProjectDependencyGraph.cs (42)
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; 60private static readonly ObjectPool<ImmutableHashSet<ProjectId>.Builder> s_reverseReferencesBuilderPool = new(static () => ImmutableHashSet.CreateBuilder<ProjectId>(), size: 256); 69ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 71ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 72ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 77ImmutableHashSet<ProjectId> projectIds, 78ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 83transitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 84reverseTransitiveReferencesMap: ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Empty, 92ImmutableHashSet<ProjectId> projectIds, 93ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap, 94ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap, 95ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> transitiveReferencesMap, 96ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> reverseTransitiveReferencesMap, 115internal ImmutableHashSet<ProjectId> ProjectIds { get; } 117private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> RemoveItemsWithEmptyValues( 118ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> map) 120ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>.Builder? builder = null; 203private ImmutableHashSet<ProjectId> GetProjectsThatDirectlyDependOnThisProject_NoLock(ProjectId projectId) 214private ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeReverseReferencesMap() 216using var _1 = PooledDictionary<ProjectId, ImmutableHashSet<ProjectId>.Builder>.GetInstance(out var reverseReferencesMapBuilders); 232var reverseReferencesBuilder = ImmutableDictionary.CreateBuilder<ProjectId, ImmutableHashSet<ProjectId>>(); 236var reverseReferencesForProject = builder.ToImmutableHashSet(); 252internal ImmutableHashSet<ProjectId>? TryGetProjectsThatThisProjectTransitivelyDependsOn(ProjectId projectId) 259_transitiveReferencesMap.TryGetValue(projectId, out var projects); 275if (currentMap.TryGetValue(projectId, out var transitiveReferences)) 288private ImmutableHashSet<ProjectId> GetProjectsThatThisProjectTransitivelyDependsOn_NoLock(ProjectId projectId) 290if (!_transitiveReferencesMap.TryGetValue(projectId, out var transitiveReferences)) 327if (currentMap.TryGetValue(projectId, out var reverseTransitiveReferences)) 340private ImmutableHashSet<ProjectId> GetProjectsThatTransitivelyDependOnThisProject_NoLock(ProjectId projectId) 342if (!_reverseTransitiveReferencesMap.TryGetValue(projectId, out var reverseTransitiveReferences)) 357var otherProjects = this.GetProjectsThatDirectlyDependOnThisProject_NoLock(project); 410if (_referencesMap.TryGetValue(projectId, out var projectReferenceIds)) 489ImmutableHashSet<ProjectId> projectIds, 490ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> referencesMap) 509ImmutableHashSet<ProjectId> projectIds, 510ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> forwardReferencesMap, 511ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? reverseReferencesMap) 549public ImmutableHashSet<ProjectId>? TryGetProjectsThatTransitivelyDependOnThisProject(ProjectId projectId)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (13)
58private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForAdditionalProjectReferences( 59ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReferencesMap, 63if (existingReferencesMap.TryGetValue(projectId, out var existingReferences)) 78private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForAdditionalProjectReferences( 79ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 99private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForAdditionalProjectReferences( 100ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 112if (existingTransitiveReferencesMap.TryGetValue(referencedProjectId, out var additionalTransitiveReferences)) 128existingTransitiveReferencesMap.TryGetValue(projectIdToUpdate, out var existingTransitiveReferences); 155private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForAdditionalProjectReferences( 156ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap, 164existingReverseTransitiveReferencesMap.TryGetValue(projectId, out var newReverseTranstiveReferences); 176existingReverseTransitiveReferencesMap.TryGetValue(projectIdToUpdate, out var existingReverseTransitiveReferences);
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (12)
17if (!_referencesMap.TryGetValue(projectId, out var referencedProjectIds)) 21var projectIds = ProjectIds; 39private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedAllProjectReferences( 40ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 57private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedAllProjectReferences( 58ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 60ImmutableHashSet<ProjectId> referencedProjectIds) 76private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedAllProjectReferences( 77ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 79ImmutableHashSet<ProjectId> referencedProjectIds) 103private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedAllProjectReferences( 104ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\ProjectDependencyGraph_RemoveProject.cs (13)
18var projectIds = ProjectIds.Remove(projectId); 51private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProject( 52ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 53ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 62if (existingReverseReferencesMap.TryGetValue(removedProjectId, out var referencingProjects)) 90private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProject( 91ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 92ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 101if (!existingForwardReferencesMap.TryGetValue(removedProjectId, out var forwardReferences)) 125private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProject( 126ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 153private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProject( 154ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (9)
19var projectIds = ProjectIds; 37private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReferencesMapForRemovedProjectReference( 38ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingForwardReferencesMap, 54private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? ComputeNewReverseReferencesMapForRemovedProjectReference( 55ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>>? existingReverseReferencesMap, 67private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewTransitiveReferencesMapForRemovedProjectReference( 68ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingTransitiveReferencesMap, 94private static ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> ComputeNewReverseTransitiveReferencesMapForRemovedProjectReference( 95ImmutableDictionary<ProjectId, ImmutableHashSet<ProjectId>> existingReverseTransitiveReferencesMap,
Microsoft.CodeAnalysis.Workspaces.MSBuild (7)
MSBuild\MSBuildProjectLoader.cs (2)
176var projectFilter = ImmutableHashSet<string>.Empty;
MSBuild\MSBuildProjectLoader.SolutionFilterReader.cs (1)
23public static bool TryRead(string filterFilename, PathResolver pathResolver, [NotNullWhen(true)] out string? solutionFilename, out ImmutableHashSet<string> projectFilter)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (4)
23public ImmutableHashSet<ProjectReference> ProjectReferences { get; } 26public ResolvedReferences(ImmutableHashSet<ProjectReference> projectReferences, ImmutableArray<MetadataReference> metadataReferences) 56private readonly ImmutableHashSet<ProjectReference>.Builder _projectReferences; 179private ImmutableHashSet<ProjectReference> GetProjectReferences()
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (78)
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (10)
24private ImmutableHashSet<V>.Enumerator _values; 37var set = v._value as ImmutableHashSet<V>; 121var set = _value as ImmutableHashSet<V>; 134_equalityComparer = equalityComparer ?? ImmutableHashSet<V>.Empty.KeyComparer; 156var set = _value as ImmutableHashSet<V>; 172var set = _value as ImmutableHashSet<V>;
src\Dependencies\Collections\ImmutableSegmentedHashSet.cs (1)
81/// <inheritdoc cref="ImmutableHashSet.ToImmutableHashSet{TSource}(ImmutableHashSet{TSource}.Builder)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (24)
18/// best for <see cref="ImmutableHashSet{T}"/>.</para> 27/// <description><see cref="ImmutableHashSet{T}"/> Complexity</description> 66/// <inheritdoc cref="ImmutableHashSet{T}.Empty"/> 76/// <inheritdoc cref="ImmutableHashSet{T}.KeyComparer"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Count"/> 84/// <inheritdoc cref="ImmutableHashSet{T}.IsEmpty"/> 105/// <inheritdoc cref="ImmutableHashSet{T}.Add(T)"/> 128/// <inheritdoc cref="ImmutableHashSet{T}.Clear()"/> 141/// <inheritdoc cref="ImmutableHashSet{T}.Contains(T)"/> 145/// <inheritdoc cref="ImmutableHashSet{T}.Except(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.GetEnumerator()"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Intersect(IEnumerable{T})"/> 195/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSubsetOf(IEnumerable{T})"/> 199/// <inheritdoc cref="ImmutableHashSet{T}.IsProperSupersetOf(IEnumerable{T})"/> 203/// <inheritdoc cref="ImmutableHashSet{T}.IsSubsetOf(IEnumerable{T})"/> 207/// <inheritdoc cref="ImmutableHashSet{T}.IsSupersetOf(IEnumerable{T})"/> 211/// <inheritdoc cref="ImmutableHashSet{T}.Overlaps(IEnumerable{T})"/> 215/// <inheritdoc cref="ImmutableHashSet{T}.Remove(T)"/> 233/// <inheritdoc cref="ImmutableHashSet{T}.SetEquals(IEnumerable{T})"/> 237/// <inheritdoc cref="ImmutableHashSet{T}.SymmetricExcept(IEnumerable{T})"/> 263/// <inheritdoc cref="ImmutableHashSet{T}.TryGetValue(T, out T)"/> 276/// <inheritdoc cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> 295/// <inheritdoc cref="ImmutableHashSet{T}.ToBuilder()"/> 302/// <inheritdoc cref="ImmutableHashSet{T}.WithComparer(IEqualityComparer{T}?)"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (19)
24/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 31/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 36/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 40/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 44/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 48/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 63/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 67/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 71/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 75/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 79/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 87/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 91/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 95/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 99/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 103/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 107/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 111/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Enumerator.cs (5)
13/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator"/> 25/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Current"/> 30/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Dispose()"/> 34/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.MoveNext()"/> 38/// <inheritdoc cref="ImmutableHashSet{T}.Enumerator.Reset()"/>
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (19)
35/// <inheritdoc cref="ImmutableHashSet{T}.Builder.KeyComparer"/> 53/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Count"/> 74/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Add(T)"/> 83/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Clear()"/> 100/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Contains(T)"/> 104/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ExceptWith(IEnumerable{T})"/> 165/// <inheritdoc cref="ImmutableHashSet{T}.Builder.GetEnumerator()"/> 169/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IntersectWith(IEnumerable{T})"/> 173/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSubsetOf(IEnumerable{T})"/> 177/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsProperSupersetOf(IEnumerable{T})"/> 181/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSubsetOf(IEnumerable{T})"/> 185/// <inheritdoc cref="ImmutableHashSet{T}.Builder.IsSupersetOf(IEnumerable{T})"/> 189/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Overlaps(IEnumerable{T})"/> 193/// <inheritdoc cref="ImmutableHashSet{T}.Builder.Remove(T)"/> 202/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SetEquals(IEnumerable{T})"/> 206/// <inheritdoc cref="ImmutableHashSet{T}.Builder.SymmetricExceptWith(IEnumerable{T})"/> 210/// <inheritdoc cref="ImmutableHashSet{T}.Builder.TryGetValue(T, out T)"/> 223/// <inheritdoc cref="ImmutableHashSet{T}.Builder.UnionWith(IEnumerable{T})"/> 261/// <inheritdoc cref="ImmutableHashSet{T}.Builder.ToImmutable()"/>
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (13)
MEF\TestComposition.cs (13)
34public CacheKey(ImmutableHashSet<Assembly> assemblies, ImmutableHashSet<Type> parts, ImmutableHashSet<Type> excludedPartTypes) 62public readonly ImmutableHashSet<Assembly> Assemblies; 68public readonly ImmutableHashSet<Type> ExcludedPartTypes; 73public readonly ImmutableHashSet<Type> Parts; 77private TestComposition(ImmutableHashSet<Assembly> assemblies, ImmutableHashSet<Type> parts, ImmutableHashSet<Type> excludedPartTypes) 132var configurationOverlap = Parts.Intersect(ExcludedPartTypes); 183public TestComposition WithAssemblies(ImmutableHashSet<Assembly> assemblies) 205public TestComposition WithParts(ImmutableHashSet<Type> parts) 208public TestComposition WithExcludedPartTypes(ImmutableHashSet<Type> excludedPartTypes)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn4.0.cs (1)
48ImmutableHashSet<ClassDeclarationSyntax> distinctClasses = classes.ToImmutableHashSet();
Microsoft.Gen.Logging (1)
LoggingGenerator.cs (1)
39ImmutableHashSet<TypeDeclarationSyntax> distinctTypes = types.ToImmutableHashSet();
Microsoft.Interop.SourceGeneration (12)
MarshallingInfoParser.cs (6)
287private ImmutableHashSet<string> _activeInspectingElements = ImmutableHashSet<string>.Empty; 300ImmutableHashSet<string> inspectedElements = _activeInspectingElements; 327ImmutableHashSet<string> inspectedElements = _activeInspectingElements; 356public CyclicalElementInfoException(ImmutableHashSet<string> elementsInCycle, string startOfCycle) 362public ImmutableHashSet<string> ElementsInCycle { get; }
TypeSymbolExtensions.cs (6)
37static bool IsConsideredBlittableWorker(ITypeSymbol t, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation) 62static unsafe bool IsStrictlyBlittableWorker(ITypeSymbol t, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation) 100private static unsafe bool IsBlittableWorker(this ITypeSymbol type, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation, delegate*<ITypeSymbol, ImmutableHashSet<ITypeSymbol>, Compilation, bool> isBlittable) 147private static unsafe bool HasOnlyBlittableFields(this ITypeSymbol type, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation, delegate*<ITypeSymbol, ImmutableHashSet<ITypeSymbol>, Compilation, bool> isBlittable)
Microsoft.VisualStudio.LanguageServices (28)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
141return ImmutableHashSet<Document>.Empty;
CommonControls\MemberSelectionViewModel.cs (1)
169private ImmutableHashSet<ISymbol> FindDependentsRecursively(ISymbol member)
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
465public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync( 507public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
308var projectAndAssemblySet = await this.GetAssemblySetAsync(
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (2)
26internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Solution solution, string languageName, CancellationToken cancellationToken) 29internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (1)
41ImmutableHashSet<(ProjectId, IAssemblySymbol)> projectAndAssemblySet,
Library\ObjectBrowser\ObjectList.cs (1)
502var projectAndAssemblySet = await this.LibraryManager.GetAssemblySetAsync(
MoveStaticMembers\StaticMemberSelectionViewModel.cs (1)
83private ImmutableHashSet<ISymbol> FindDependents(ISymbol member)
NavigateTo\RoslynSearchItemsSource.cs (2)
23private static readonly IImmutableSet<string> s_typeKinds = ImmutableHashSet<string>.Empty 30private static readonly IImmutableSet<string> s_memberKinds = ImmutableHashSet<string>.Empty
PullMemberUp\SymbolDependentsBuilder.cs (1)
36private readonly ImmutableHashSet<ISymbol> _membersInType;
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (6)
151private async Task<ImmutableHashSet<DiagnosticData>?> GetDiagnosticsToFixAsync( 155var diagnosticsToFix = ImmutableHashSet<DiagnosticData>.Empty; 474var latestDocumentDiagnosticsMap = filterStaleDiagnostics ? new Dictionary<DocumentId, ImmutableHashSet<DiagnosticData>>() : null; 513if (!latestDocumentDiagnosticsMap.TryGetValue(document.Id, out var latestDocumentDiagnostics)) 516latestDocumentDiagnostics = ImmutableHashSet<DiagnosticData>.Empty;
TaskList\ExternalErrorDiagnosticUpdateSource.cs (9)
321private readonly Dictionary<ProjectId, ImmutableHashSet<string>> _allDiagnosticIdMap = []; 334private static ImmutableHashSet<string> GetOrCreateDiagnosticIds( 336Dictionary<ProjectId, ImmutableHashSet<string>> diagnosticIdMap, 337Func<ImmutableHashSet<string>> computeDiagnosticIds) 341if (diagnosticIdMap.TryGetValue(projectId, out var ids)) 347var computedIds = computeDiagnosticIds(); 356private ImmutableHashSet<string> GetOrCreateSupportedDiagnosticIds(ProjectId projectId) 360ImmutableHashSet<string> ComputeSupportedDiagnosticIds() 366return ImmutableHashSet<string>.Empty;
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Interactive\CSharpInteractiveWindowCommandCompletionProvider.cs (1)
45public override ImmutableHashSet<char> TriggerCharacters { get; } = CompletionUtilities.SpaceTriggerCharacter;
Microsoft.VisualStudio.LanguageServices.LiveShare (8)
Client\RemoteLanguageServiceWorkspace.cs (8)
65private ImmutableHashSet<string> _remoteWorkspaceRootPaths; 70private ImmutableHashSet<string> _registeredExternalPaths; 95_remoteWorkspaceRootPaths = ImmutableHashSet<string>.Empty; 96_registeredExternalPaths = ImmutableHashSet<string>.Empty; 166private static async Task<(ImmutableHashSet<string> remoteRootPaths, ImmutableHashSet<string> externalPaths)> GetLocalPathsOfRemoteRootsAsync(CollaborationSession session) 199_remoteWorkspaceRootPaths = ImmutableHashSet<string>.Empty; 200_registeredExternalPaths = ImmutableHashSet<string>.Empty;
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (2)
327Public Function GetDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), getDocuments As Func(Of Project, DocumentId, IReadOnlyList(Of DocumentId)), includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync 331Public Function GetProjectDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeSuppressedDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Snippets\SnippetCompletionProvider.vb (2)
94Public Overrides ReadOnly Property TriggerCharacters As ImmutableHashSet(Of Char) = ImmutableHashSet(Of Char).Empty
MSBuild (1)
MSBuildLoadContext.cs (1)
24internal static readonly ImmutableHashSet<string> WellKnownAssemblyNames =
RunTests (1)
Program.cs (1)
22private static readonly ImmutableHashSet<string> PrimaryProcessNames = ImmutableHashSet.Create(
System.Collections.Immutable (116)
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
165ImmutableHashSet<T> ihs => _thisSet.Comparer.Equals(ihs.KeyComparer),
System\Collections\Immutable\ImmutableHashSet.cs (27)
9/// A set of initialization methods for instances of <see cref="ImmutableHashSet{T}"/>. 18public static ImmutableHashSet<T> Create<T>() 20return ImmutableHashSet<T>.Empty; 31public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer) 33return ImmutableHashSet<T>.Empty.WithComparer(equalityComparer); 42public static ImmutableHashSet<T> Create<T>(T item) 44return ImmutableHashSet<T>.Empty.Add(item); 54public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, T item) 56return ImmutableHashSet<T>.Empty.WithComparer(equalityComparer).Add(item); 65public static ImmutableHashSet<T> CreateRange<T>(IEnumerable<T> items) 67return ImmutableHashSet<T>.Empty.Union(items); 77public static ImmutableHashSet<T> CreateRange<T>(IEqualityComparer<T>? equalityComparer, IEnumerable<T> items) 79return ImmutableHashSet<T>.Empty.WithComparer(equalityComparer).Union(items); 88public static ImmutableHashSet<T> Create<T>(params T[] items) 101public static ImmutableHashSet<T> Create<T>(params ReadOnlySpan<T> items) 103return ImmutableHashSet<T>.Empty.Union(items); 113public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, params T[] items) 127public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, params ReadOnlySpan<T> items) 129return ImmutableHashSet<T>.Empty.WithComparer(equalityComparer).Union(items); 137public static ImmutableHashSet<T>.Builder CreateBuilder<T>() 150public static ImmutableHashSet<T>.Builder CreateBuilder<T>(IEqualityComparer<T>? equalityComparer) 162public static ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource>? equalityComparer) 164if (source is ImmutableHashSet<TSource> existingSet) 169return ImmutableHashSet<TSource>.Empty.WithComparer(equalityComparer).Union(source); 177public static ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this ImmutableHashSet<TSource>.Builder builder) 191public static ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this IEnumerable<TSource> source)
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (27)
11/// Contains the inner <see cref="ImmutableHashSet{T}.Builder"/> class. 21/// While <see cref="ImmutableHashSet{T}.Union(IEnumerable{T})"/> and other bulk change methods 56private ImmutableHashSet<T>? _immutable; 64/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.Builder"/> class. 67internal Builder(ImmutableHashSet<T> set) 118ImmutableHashSet<T>.MutationResult result = Union(this, new MutationInput(SortedInt32KeyNode<HashBucket>.EmptyNode, value, _hashBucketEqualityComparer, 0)); 192public ImmutableHashSet<T> ToImmutable() 197return _immutable ??= ImmutableHashSet<T>.Wrap(_root, _equalityComparer, _count); 229ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.Add(item, this.Origin); 244ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.Remove(item, this.Origin); 258return ImmutableHashSet<T>.Contains(item, this.Origin); 277ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.Except(other, _equalityComparer, _hashBucketEqualityComparer, _root); 287ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.Intersect(other, this.Origin); 298return ImmutableHashSet<T>.IsProperSubsetOf(other, this.Origin); 308return ImmutableHashSet<T>.IsProperSupersetOf(other, this.Origin); 318return ImmutableHashSet<T>.IsSubsetOf(other, this.Origin); 328return ImmutableHashSet<T>.IsSupersetOf(other, this.Origin); 338return ImmutableHashSet<T>.Overlaps(other, this.Origin); 353return ImmutableHashSet<T>.SetEquals(other, this.Origin); 362ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.SymmetricExcept(other, this.Origin); 372ImmutableHashSet<T>.MutationResult result = ImmutableHashSet<T>.Union(other, this.Origin);
System\Collections\Immutable\ImmutableHashSet_1.cs (41)
19public sealed partial class ImmutableHashSet<T> : IImmutableSet<T>, IReadOnlyCollection<T>, ICollection<T>, ISet<T>, IReadOnlySet<T>, ICollection, IStrongEnumerable<T, ImmutableHashSet<T>.Enumerator> 27public static readonly ImmutableHashSet<T> Empty = new ImmutableHashSet<T>(SortedInt32KeyNode<HashBucket>.EmptyNode, EqualityComparer<T>.Default, 0); 55/// Initializes a new instance of the <see cref="ImmutableHashSet{T}"/> class. 64/// Initializes a new instance of the <see cref="ImmutableHashSet{T}"/> class. 84public ImmutableHashSet<T> Clear() 86return this.IsEmpty ? this : ImmutableHashSet<T>.Empty.WithComparer(_equalityComparer); 181public ImmutableHashSet<T> Add(T item) 183ImmutableHashSet<T>.MutationResult result = Add(item, this.Origin); 190public ImmutableHashSet<T> Remove(T item) 192ImmutableHashSet<T>.MutationResult result = Remove(item, this.Origin); 224public ImmutableHashSet<T> Union(IEnumerable<T> other) 234internal ImmutableHashSet<T> Union(ReadOnlySpan<T> other) 242public ImmutableHashSet<T> Intersect(IEnumerable<T> other) 246ImmutableHashSet<T>.MutationResult result = Intersect(other, this.Origin); 253public ImmutableHashSet<T> Except(IEnumerable<T> other) 257ImmutableHashSet<T>.MutationResult result = Except(other, _equalityComparer, _hashBucketEqualityComparer, _root); 266public ImmutableHashSet<T> SymmetricExcept(IEnumerable<T> other) 270ImmutableHashSet<T>.MutationResult result = SymmetricExcept(other, this.Origin); 416public ImmutableHashSet<T> WithComparer(IEqualityComparer<T>? equalityComparer) 426var result = new ImmutableHashSet<T>(equalityComparer); 619ImmutableHashSet<T>.HashBucket newBucket = bucket.Add(item, origin.EqualityComparer, out result); 625SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, origin.HashBucketEqualityComparer, newBucket); 635ImmutableHashSet<T>.OperationResult result = OperationResult.NoChangeRequired; 638SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 641ImmutableHashSet<T>.HashBucket newBucket = bucket.Remove(item, origin.EqualityComparer, out result); 676SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 682ImmutableHashSet<T>.HashBucket newBucket = bucket.Add(item, origin.EqualityComparer, out result); 699SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 705ImmutableHashSet<T>.HashBucket newBucket = bucket.Add(item, origin.EqualityComparer, out result); 784SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newSet = SortedInt32KeyNode<HashBucket>.EmptyNode; 790ImmutableHashSet<T>.MutationResult result = Add(item, new MutationInput(newSet, origin.EqualityComparer, origin.HashBucketEqualityComparer, count)); 809SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = root; 836ImmutableHashSet<T> otherAsSet = ImmutableHashSet.CreateRange(origin.EqualityComparer, other); 839SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> result = SortedInt32KeyNode<HashBucket>.EmptyNode; 844ImmutableHashSet<T>.MutationResult mutationResult = Add(item, new MutationInput(result, origin.EqualityComparer, origin.HashBucketEqualityComparer, count)); 854ImmutableHashSet<T>.MutationResult mutationResult = Add(item, new MutationInput(result, origin.EqualityComparer, origin.HashBucketEqualityComparer, count)); 978private static ImmutableHashSet<T> Wrap(SortedInt32KeyNode<HashBucket> root, IEqualityComparer<T> equalityComparer, int count) 1013private ImmutableHashSet<T> Wrap(SortedInt32KeyNode<HashBucket> root, int adjustedCountIfDifferentRoot) 1023private ImmutableHashSet<T> Union(IEnumerable<T> items, bool avoidWithComparer) 1032if (items is ImmutableHashSet<T> other) 1038ImmutableHashSet<T>.MutationResult result = Union(items, this.Origin);
System\Collections\Immutable\ImmutableHashSet_1.Enumerator.cs (2)
9/// Contains the inner <see cref="ImmutableHashSet{T}.Enumerator"/> class. 39/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.Enumerator"/> struct.
System\Collections\Immutable\ImmutableHashSet_1.HashBucket.cs (2)
10/// Contains the inner <see cref="ImmutableHashSet{T}.HashBucket"/> struct. 274/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.HashBucket.Enumerator"/> struct.
System\Collections\Immutable\ImmutableHashSet_1.HashBucketByRefEqualityComparer.cs (2)
9/// Contains the inner <see cref="ImmutableHashSet{T}.HashBucketByRefEqualityComparer"/> class. 11public sealed partial class ImmutableHashSet<T> : IImmutableSet<T>, IReadOnlyCollection<T>, ICollection<T>, ISet<T>, ICollection, IStrongEnumerable<T, ImmutableHashSet<T>.Enumerator>
System\Collections\Immutable\ImmutableHashSet_1.HashBucketByValueEqualityComparer.cs (2)
9/// Contains the inner <see cref="ImmutableHashSet{T}.HashBucketByValueEqualityComparer"/> class. 11public sealed partial class ImmutableHashSet<T> : IImmutableSet<T>, IReadOnlyCollection<T>, ICollection<T>, ISet<T>, ICollection, IStrongEnumerable<T, ImmutableHashSet<T>.Enumerator>
System\Collections\Immutable\ImmutableHashSet_1.MutationInput.cs (4)
9/// Contains the inner <see cref="ImmutableHashSet{T}.MutationInput"/> class. 40/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.MutationInput"/> struct. 43internal MutationInput(ImmutableHashSet<T> set) 53/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.MutationInput"/> struct.
System\Collections\Immutable\ImmutableHashSet_1.MutationResult.cs (6)
7/// Contains the inner <see cref="ImmutableHashSet{T}.MutationResult"/> class. 50/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.MutationResult"/> struct. 55internal MutationResult(SortedInt32KeyNode<HashBucket> root, int count, CountType countType = ImmutableHashSet<T>.CountType.Adjustment) 94internal ImmutableHashSet<T> Finalize(ImmutableHashSet<T> priorSet) 98if (this.CountType == ImmutableHashSet<T>.CountType.Adjustment)
System\Collections\Immutable\ImmutableHashSet_1.NodeEnumerable.cs (2)
10/// Contains the inner <see cref="ImmutableHashSet{T}.NodeEnumerable"/> class. 25/// Initializes a new instance of the <see cref="ImmutableHashSet{T}.NodeEnumerable"/> struct.
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
106public INamedTypeSymbol? ImmutableHashSetType => GetOrResolveType(typeof(ImmutableHashSet<>), ref _ImmutableHashSetType);
System.Windows.Forms.Tests (1)
System\Windows\Forms\Design\DesignerAttributeTests.cs (1)
19private static ImmutableHashSet<string> SkipList { get; } =
xunit.assert (2)
SetAsserts.cs (2)
112 ImmutableHashSet<T> set) => 219 ImmutableHashSet<T> set) =>