11 instantiations of IncrementalValuesProvider
Microsoft.CodeAnalysis (11)
SourceGeneration\Nodes\ValueSourceExtensions.cs (8)
35public static IncrementalValuesProvider<TResult> Select<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, TResult> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
46public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
57public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
68public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
79public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
99public static IncrementalValuesProvider<(TLeft Left, TRight Right)> Combine<TLeft, TRight>(this IncrementalValuesProvider<TLeft> provider1, IncrementalValueProvider<TRight> provider2) => new IncrementalValuesProvider<(TLeft, TRight)>(new CombineNode<TLeft, TRight>(provider1.Node, provider2.Node), provider1.CatchAnalyzerExceptions);
143public static IncrementalValuesProvider<TSource> WithComparer<TSource>(this IncrementalValuesProvider<TSource> source, IEqualityComparer<TSource> comparer) => new IncrementalValuesProvider<TSource>(source.Node.WithComparer(comparer.WrapUserComparer(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
163public static IncrementalValuesProvider<TSource> WithTrackingName<TSource>(this IncrementalValuesProvider<TSource> source, string name) => new IncrementalValuesProvider<TSource>(source.Node.WithTrackingName(name), source.CatchAnalyzerExceptions);
165 references to IncrementalValuesProvider
EventSourceGenerator (1)
Microsoft.AspNetCore.Components.Testing.Generators (2)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
Microsoft.AspNetCore.OpenApi.SourceGenerators (5)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
Microsoft.CodeAnalysis (68)
SourceGeneration\IncrementalContexts.cs (13)
77/// Gets an <see cref="IncrementalValuesProvider{T}"/> that provides access to all <see cref="AdditionalText"/> files included in the compilation.
81public IncrementalValuesProvider<AdditionalText> AdditionalTextsProvider => new IncrementalValuesProvider<AdditionalText>(SharedInputNodes.AdditionalTexts.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.AdditionalTexts), CatchAnalyzerExceptions);
90/// Gets an <see cref="IncrementalValuesProvider{T}"/> that provides access to all <see cref="MetadataReference"/>s in the compilation.
93public IncrementalValuesProvider<MetadataReference> MetadataReferencesProvider => new IncrementalValuesProvider<MetadataReference>(SharedInputNodes.MetadataReferences.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.MetadataReferences), CatchAnalyzerExceptions);
109/// <param name="source">An <see cref="IncrementalValuesProvider{TSource}"/> that provides input values</param>
111public void RegisterSourceOutput<TSource>(IncrementalValuesProvider<TSource> source, Action<SourceProductionContext, TSource> action) => RegisterSourceOutput(source.Node, action, IncrementalGeneratorOutputKind.Source, _sourceExtension);
129/// <param name="source">An <see cref="IncrementalValuesProvider{TSource}"/> that provides input values</param>
131public void RegisterImplementationSourceOutput<TSource>(IncrementalValuesProvider<TSource> source, Action<SourceProductionContext, TSource> action) => RegisterSourceOutput(source.Node, action, IncrementalGeneratorOutputKind.Implementation, _sourceExtension);
162/// <param name="source">An <see cref="IncrementalValuesProvider{TSource}"/> that provides input values</param>
165public void RegisterHostOutput<TSource>(IncrementalValuesProvider<TSource> source, Action<HostOutputProductionContext, TSource> action) => source.Node.RegisterOutput(new HostOutputNode<TSource>(source.Node, action.WrapUserAction(CatchAnalyzerExceptions)));
189/// <param name="source">An <see cref="IncrementalValuesProvider{TSource}"/> that provides input values</param>
197public void RegisterPreCompilationSourceOutput<TSource>(IncrementalValuesProvider<TSource> source, Action<PreCompilationSourceProductionContext, TSource> action) => RegisterPreCompilationSourceOutput(source.Node, action);
387/// Context passed to an incremental generator when it has registered an output via <see cref="IncrementalGeneratorInitializationContext.RegisterHostOutput{TSource}(IncrementalValuesProvider{TSource}, Action{HostOutputProductionContext, TSource})"/>
SourceGeneration\Nodes\ValueSourceExtensions.cs (41)
27/// Transforms an <see cref="IncrementalValuesProvider{TSource}"/> into a new <see cref="IncrementalValuesProvider{TResult}"/> by applying a transform function to each value.
34/// <returns>A new <see cref="IncrementalValuesProvider{TResult}"/> that provides the transformed values</returns>
35public static IncrementalValuesProvider<TResult> Select<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, TResult> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
38/// Transforms an <see cref="IncrementalValueProvider{TSource}"/> into a new <see cref="IncrementalValuesProvider{TResult}"/> by applying a transform function that returns zero or more results for the input value.
45/// <returns>A new <see cref="IncrementalValuesProvider{TResult}"/> that provides the transformed values</returns>
46public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
49/// Transforms an <see cref="IncrementalValueProvider{TSource}"/> into a new <see cref="IncrementalValuesProvider{TResult}"/> by applying a transform function that returns zero or more results for the input value.
56/// <returns>A new <see cref="IncrementalValuesProvider{TResult}"/> that provides the transformed values</returns>
57public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
60/// Transforms an <see cref="IncrementalValuesProvider{TSource}"/> into a new <see cref="IncrementalValuesProvider{TResult}"/> by applying a transform function that returns zero or more results for each input value.
67/// <returns>A new <see cref="IncrementalValuesProvider{TResult}"/> that provides the transformed values</returns>
68public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions);
71/// Transforms an <see cref="IncrementalValuesProvider{TSource}"/> into a new <see cref="IncrementalValuesProvider{TResult}"/> by applying a transform function that returns zero or more results for each input value.
78/// <returns>A new <see cref="IncrementalValuesProvider{TResult}"/> that provides the transformed values</returns>
79public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
82/// Collects all values from an <see cref="IncrementalValuesProvider{TSource}"/> into a single <see cref="IncrementalValueProvider{T}"/> containing an <see cref="ImmutableArray{TSource}"/>.
88public static IncrementalValueProvider<ImmutableArray<TSource>> Collect<TSource>(this IncrementalValuesProvider<TSource> source) => new IncrementalValueProvider<ImmutableArray<TSource>>(new BatchNode<TSource>(source.Node), source.CatchAnalyzerExceptions);
91/// Combines an <see cref="IncrementalValuesProvider{TLeft}"/> with an <see cref="IncrementalValueProvider{TRight}"/> to create a new <see cref="IncrementalValuesProvider{T}"/> of tuples.
98/// <returns>A new <see cref="IncrementalValuesProvider{T}"/> that provides tuples of (TLeft, TRight)</returns>
99public static IncrementalValuesProvider<(TLeft Left, TRight Right)> Combine<TLeft, TRight>(this IncrementalValuesProvider<TLeft> provider1, IncrementalValueProvider<TRight> provider2) => new IncrementalValuesProvider<(TLeft, TRight)>(new CombineNode<TLeft, TRight>(provider1.Node, provider2.Node), provider1.CatchAnalyzerExceptions);
113/// Filters values from an <see cref="IncrementalValuesProvider{TSource}"/> based on a predicate, producing a new <see cref="IncrementalValuesProvider{TSource}"/> containing only values that satisfy the predicate.
118/// <returns>A new <see cref="IncrementalValuesProvider{TSource}"/> that provides only values where the predicate returns <c>true</c></returns>
119public static IncrementalValuesProvider<TSource> Where<TSource>(this IncrementalValuesProvider<TSource> source, Func<TSource, bool> predicate) => source.SelectMany((item, _) => predicate(item) ? ImmutableArray.Create(item) : ImmutableArray<TSource>.Empty);
121internal static IncrementalValuesProvider<TSource> Where<TSource>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, bool> predicate) => source.SelectMany((item, c) => predicate(item, c) ? ImmutableArray.Create(item) : ImmutableArray<TSource>.Empty);
142/// <returns>A new <see cref="IncrementalValuesProvider{TSource}"/> that uses the specified comparer</returns>
143public static IncrementalValuesProvider<TSource> WithComparer<TSource>(this IncrementalValuesProvider<TSource> source, IEqualityComparer<TSource> comparer) => new IncrementalValuesProvider<TSource>(source.Node.WithComparer(comparer.WrapUserComparer(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
162/// <returns>A new <see cref="IncrementalValuesProvider{TSource}"/> with the specified tracking name</returns>
163public static IncrementalValuesProvider<TSource> WithTrackingName<TSource>(this IncrementalValuesProvider<TSource> source, string name) => new IncrementalValuesProvider<TSource>(source.Node.WithTrackingName(name), source.CatchAnalyzerExceptions);
Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler (1)
Microsoft.CodeAnalysis.Razor.Compiler (14)
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.Validation.ValidationsGenerator (12)
Microsoft.Gen.BuildMetadata (1)
Microsoft.Gen.ComplianceReports (1)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.Logging (2)
Microsoft.Gen.MetadataExtractor (1)
Microsoft.Gen.Metrics (1)
Microsoft.Gen.MetricsReports (1)
Microsoft.Interop.ComInterfaceGenerator (8)
Microsoft.Interop.JavaScript.JSImportGenerator (4)
Microsoft.Interop.LibraryImportGenerator (2)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (9)
Microsoft.Maui.Controls.BindingSourceGen (2)
Microsoft.Maui.Controls.SourceGen (4)
System.Private.CoreLib.Generators (3)
System.Text.Json.SourceGeneration (3)
System.Windows.Forms.Analyzers.CSharp (1)
System.Windows.Forms.PrivateSourceGenerators (2)