11 instantiations of IncrementalValuesProvider
Microsoft.CodeAnalysis (11)
SourceGeneration\IncrementalContexts.cs (2)
63
public IncrementalValuesProvider<AdditionalText> AdditionalTextsProvider => new
IncrementalValuesProvider
<AdditionalText>(SharedInputNodes.AdditionalTexts.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.AdditionalTexts), CatchAnalyzerExceptions);
67
public IncrementalValuesProvider<MetadataReference> MetadataReferencesProvider => new
IncrementalValuesProvider
<MetadataReference>(SharedInputNodes.MetadataReferences.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.MetadataReferences), CatchAnalyzerExceptions);
SourceGeneration\Nodes\SyntaxValueProvider.cs (1)
45
return new
IncrementalValuesProvider
<T>(
SourceGeneration\Nodes\ValueSourceExtensions.cs (8)
18
public 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);
21
public 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);
23
public 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);
25
public 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);
27
public 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);
31
public 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);
43
public static IncrementalValuesProvider<TSource> WithComparer<TSource>(this IncrementalValuesProvider<TSource> source, IEqualityComparer<TSource> comparer) => new
IncrementalValuesProvider
<TSource>(source.Node.WithComparer(comparer.WrapUserComparer(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
48
public static IncrementalValuesProvider<TSource> WithTrackingName<TSource>(this IncrementalValuesProvider<TSource> source, string name) => new
IncrementalValuesProvider
<TSource>(source.Node.WithTrackingName(name), source.CatchAnalyzerExceptions);
336 references to IncrementalValuesProvider
IdeCoreBenchmarks (1)
IncrementalSourceGeneratorBenchmarks.cs (1)
122
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName(
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
RequestDelegateGenerator.cs (3)
22
var
endpointsWithDiagnostics = context.SyntaxProvider.CreateSyntaxProvider(
50
var
endpoints = endpointsWithDiagnostics
54
var
interceptorDefinitions = endpoints
src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (2)
11
public static
IncrementalValuesProvider
<(TSource Source, int Index, ImmutableArray<TElement> Elements)> GroupWith<TSource, TElement>(
12
this
IncrementalValuesProvider
<TSource> source,
Microsoft.AspNetCore.OpenApi.SourceGenerators (5)
src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (2)
11
public static
IncrementalValuesProvider
<(TSource Source, int Index, ImmutableArray<TElement> Elements)> GroupWith<TSource, TElement>(
12
this
IncrementalValuesProvider
<TSource> source,
XmlCommentGenerator.cs (3)
16
var
commentsFromXmlFile = context.AdditionalTextsProvider
25
var
parsedCommentsFromXmlFile = commentsFromXmlFile
38
var
generatedCommentsFromXmlFile = parsedCommentsFromXmlFile
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.cs (1)
21
var
memberAccessExpressions = context.SyntaxProvider
HubServerProxyGenerator.cs (1)
21
var
memberAccessExpressions = context.SyntaxProvider
Microsoft.CodeAnalysis (38)
SourceGeneration\IncrementalContexts.cs (6)
63
public
IncrementalValuesProvider
<AdditionalText> AdditionalTextsProvider => new IncrementalValuesProvider<AdditionalText>(SharedInputNodes.AdditionalTexts.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.AdditionalTexts), CatchAnalyzerExceptions);
67
public
IncrementalValuesProvider
<MetadataReference> MetadataReferencesProvider => new IncrementalValuesProvider<MetadataReference>(SharedInputNodes.MetadataReferences.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.MetadataReferences), CatchAnalyzerExceptions);
71
public void RegisterSourceOutput<TSource>(
IncrementalValuesProvider
<TSource> source, Action<SourceProductionContext, TSource> action) => RegisterSourceOutput(source.Node, action, IncrementalGeneratorOutputKind.Source, _sourceExtension);
75
public void RegisterImplementationSourceOutput<TSource>(
IncrementalValuesProvider
<TSource> source, Action<SourceProductionContext, TSource> action) => RegisterSourceOutput(source.Node, action, IncrementalGeneratorOutputKind.Implementation, _sourceExtension);
83
public void RegisterHostOutput<TSource>(
IncrementalValuesProvider
<TSource> source, Action<HostOutputProductionContext, TSource> action) => source.Node.RegisterOutput(new HostOutputNode<TSource>(source.Node, action.WrapUserAction(CatchAnalyzerExceptions)));
224
/// 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\IIncrementalGeneratorOutputNode.cs (3)
38
/// or <see cref="IncrementalGeneratorInitializationContext.RegisterSourceOutput{TSource}(
IncrementalValuesProvider
{TSource}, Action{SourceProductionContext, TSource})"/>
49
/// or <see cref="IncrementalGeneratorInitializationContext.RegisterImplementationSourceOutput{TSource}(
IncrementalValuesProvider
{TSource}, Action{SourceProductionContext, TSource})"/>
55
/// or <see cref="IncrementalGeneratorInitializationContext.RegisterHostOutput{TSource}(
IncrementalValuesProvider
{TSource}, Action{HostOutputProductionContext, TSource})"/>
SourceGeneration\Nodes\SyntaxValueProvider.cs (1)
42
public
IncrementalValuesProvider
<T> CreateSyntaxProvider<T>(Func<SyntaxNode, CancellationToken, bool> predicate, Func<GeneratorSyntaxContext, CancellationToken, T> transform)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (5)
64
/// Creates an <see cref="
IncrementalValuesProvider
{T}"/> that can provide a transform over all <see
78
public
IncrementalValuesProvider
<T> ForAttributeWithMetadataName<T>(
87
var
nodesWithAttributesMatchingSimpleName = this.ForAttributeWithSimpleName(metadataName.UnmangledTypeName, predicate);
89
var
compilationAndGroupedNodesProvider = nodesWithAttributesMatchingSimpleName
94
var
finalProvider = compilationAndGroupedNodesProvider.SelectMany((tuple, cancellationToken) =>
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (4)
55
internal
IncrementalValuesProvider
<(SyntaxTree tree, ImmutableArray<SyntaxNode> matches)> ForAttributeWithSimpleName(
65
var
syntaxTreesProvider = _context.CompilationProvider
70
var
individualFileGlobalAliasesProvider = syntaxTreesProvider
102
var
syntaxTreeAndGlobalAliasesProvider = syntaxTreesProvider
SourceGeneration\Nodes\ValueSourceExtensions.cs (19)
18
public 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);
21
public 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);
23
public 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);
25
public 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);
27
public 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);
29
public static IncrementalValueProvider<ImmutableArray<TSource>> Collect<TSource>(this
IncrementalValuesProvider
<TSource> source) => new IncrementalValueProvider<ImmutableArray<TSource>>(new BatchNode<TSource>(source.Node), source.CatchAnalyzerExceptions);
31
public 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);
36
public static
IncrementalValuesProvider
<TSource> Where<TSource>(this
IncrementalValuesProvider
<TSource> source, Func<TSource, bool> predicate) => source.SelectMany((item, _) => predicate(item) ? ImmutableArray.Create(item) : ImmutableArray<TSource>.Empty);
38
internal 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);
43
public static
IncrementalValuesProvider
<TSource> WithComparer<TSource>(this
IncrementalValuesProvider
<TSource> source, IEqualityComparer<TSource> comparer) => new IncrementalValuesProvider<TSource>(source.Node.WithComparer(comparer.WrapUserComparer(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions);
48
public static
IncrementalValuesProvider
<TSource> WithTrackingName<TSource>(this
IncrementalValuesProvider
<TSource> source, string name) => new IncrementalValuesProvider<TSource>(source.Node.WithTrackingName(name), source.CatchAnalyzerExceptions);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
818
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName(
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (150)
SourceGeneration\GeneratorDriverFuzzTests.cs (20)
77
public abstract
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider);
85
public override
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider)
87
var
provider1 = provider.Select((additionalText, _) => (AdditionalText)new InMemoryAdditionalText(additionalText.Path, additionalText.GetText()!.ToString() switch
124
public override
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider)
162
public override
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider)
164
var
provider1 = provider.Where(additionalText => additionalText.GetText()!.ToString() is var textString
211
public override
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider)
213
var
provider4_1 = Source1.Apply(provider);
214
var
provider4_2 = Source2.Apply(provider);
215
var
provider4 = provider4_1.Combine(provider4_2.Collect()).Select((pair, _)
244
public override
IncrementalValuesProvider
<AdditionalText> Apply(
IncrementalValuesProvider
<AdditionalText> provider) => provider;
350
var
provider = context.AdditionalTextsProvider;
351
var
finalProvider = rootOperator.Apply(provider);
550
var
provider = context.AdditionalTextsProvider
SourceGeneration\GeneratorDriverTests.cs (12)
1501
var
name = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("Attr")
2225
var
invokedMethodsProvider = ctx.SyntaxProvider
2322
var
invokedMethodsProvider = ctx.SyntaxProvider
2441
var
input = ctx.SyntaxProvider.CreateSyntaxProvider(static (n, _) => n is ClassDeclarationSyntax, (gsc, _) => (ClassDeclarationSyntax)gsc.Node)
2684
IncrementalValuesProvider
<ClassDeclarationSyntax> classDeclarations = ctx.SyntaxProvider
3022
var
texts = ctx.AdditionalTextsProvider;
3023
var
paths = texts.Select((t, _) => t?.Path).WithTrackingName("Path");
3024
var
contents = texts.Select((t, ct) => t?.GetText(ct)?.ToString()).WithTrackingName("Content");
3671
var
flatArray = nullArray.SelectMany((a, _) => a!);
4144
var
syntax = ctx.SyntaxProvider.CreateSyntaxProvider((s, _) => true, (s, _) => s.Node);
4161
var
syntax = ctx.SyntaxProvider.CreateSyntaxProvider((s, _) => true, (s, _) => s.Node);
4182
var
provider = ctx.SyntaxProvider
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (48)
21
public static
IncrementalValuesProvider
<T> ForAttributeWithSimpleName<T>(
30
public static
IncrementalValuesProvider
<T> ForAttributeWithMetadataName<T>(
74
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("N1.XAttribute");
116
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>(name);
153
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("N2.XAttribute");
183
var
input = ctx.ForAttributeWithMetadataName<CompilationUnitSyntax>("System.CLSCompliantAttribute");
213
var
input = ctx.ForAttributeWithMetadataName<CompilationUnitSyntax>("System.CLSCompliantAttribute");
240
var
input = ctx.ForAttributeWithMetadataName<CompilationUnitSyntax>("System.CLSCompliantAttribute");
267
var
input = ctx.ForAttributeWithMetadataName<CompilationUnitSyntax>("System.CLSCompliantAttribute");
295
var
input = ctx.ForAttributeWithMetadataName<CompilationUnitSyntax>("System.CLSCompliantAttribute");
326
var
input = ctx.ForAttributeWithMetadataName<LocalFunctionStatementSyntax>("System.CLSCompliantAttribute");
362
var
input = ctx.ForAttributeWithMetadataName<LocalFunctionStatementSyntax>("System.CLSCompliantAttribute");
401
var
input = ctx.ForAttributeWithMetadataName<LocalFunctionStatementSyntax>("System.CLSCompliantAttribute");
430
var
input = ctx.ForAttributeWithMetadataName<TypeParameterSyntax>("System.CLSCompliantAttribute");
463
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.CLSCompliantAttribute");
496
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.CLSCompliantAttribute");
528
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.CLSCompliantAttribute");
560
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.CLSCompliantAttribute");
591
var
input = ctx.ForAttributeWithMetadataName<VariableDeclaratorSyntax>("System.CLSCompliantAttribute");
622
var
input = ctx.ForAttributeWithMetadataName<VariableDeclaratorSyntax>("System.CLSCompliantAttribute");
655
var
input = ctx.ForAttributeWithMetadataName<VariableDeclaratorSyntax>("System.CLSCompliantAttribute");
686
var
input = ctx.ForAttributeWithMetadataName<VariableDeclaratorSyntax>("System.CLSCompliantAttribute");
715
var
input = ctx.ForAttributeWithMetadataName<LambdaExpressionSyntax>("System.CLSCompliantAttribute");
749
var
input = ctx.ForAttributeWithMetadataName<AccessorDeclarationSyntax>("System.CLSCompliantAttribute");
778
var
input = ctx.ForAttributeWithMetadataName<TypeParameterSyntax>("System.CLSCompliantAttribute");
815
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer1+InnerAttribute");
852
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer2+InnerAttribute");
889
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer1+InnerAttribute`1");
926
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer2+InnerAttribute`2");
963
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer1+InnerAttribute`2");
999
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("Outer2+InnerAttribute`1");
1027
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1064
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1102
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1140
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1178
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1216
var
input = ctx.SyntaxProvider.ForAttributeWithMetadataName<ClassDeclarationSyntax>(
1244
var
provider = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("GenerateAttribute");
1336
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.Runtime.InteropServices.LibraryImportAttribute");
1382
var
input = ctx.ForAttributeWithMetadataName<MethodDeclarationSyntax>("System.Runtime.InteropServices.LibraryImportAttribute");
1420
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1467
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1514
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1557
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1605
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1658
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1717
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
1769
var
input = ctx.ForAttributeWithMetadataName<ClassDeclarationSyntax>("XAttribute");
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (46)
45
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
77
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
103
var
input = ctx.ForAttributeWithSimpleName<DelegateDeclarationSyntax>("XAttribute");
128
var
input = ctx.ForAttributeWithSimpleName<DelegateDeclarationSyntax>("YAttribute");
153
var
input = ctx.ForAttributeWithSimpleName<SyntaxNode>("XAttribute");
181
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
213
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
245
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
279
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
312
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
338
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
364
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("X");
390
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
423
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
451
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
479
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
506
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
537
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
570
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
602
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
634
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
662
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
690
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
718
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
745
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
772
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
801
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
832
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
862
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
891
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
919
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
947
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
976
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1008
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1048
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1094
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1147
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1198
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1253
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1306
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1364
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1412
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1457
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1508
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1559
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
1620
var
input = ctx.ForAttributeWithSimpleName<ClassDeclarationSyntax>("XAttribute");
SourceGeneration\SyntaxAwareGeneratorTests.cs (24)
857
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText);
897
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText);
903
var
source2 = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is ClassDeclarationSyntax fds, (c, _) => ((ClassDeclarationSyntax)c.Node).Identifier.ValueText);
940
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) =>
1016
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText).WithTrackingName("Fields");
1091
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText).WithTrackingName("Fields");
1172
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText);
1180
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText);
1223
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText).WithTrackingName("Fields");
1306
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText).WithTrackingName("Fields");
1384
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) =>
1515
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) => ((FieldDeclarationSyntax)c.Node).Declaration.Variables[0].Identifier.ValueText);
1572
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) =>
1623
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) =>
1634
var
comparerSource = source.WithComparer(new LambdaComparer<string>((a, b) => true));
1680
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) =>
1739
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) =>
1744
var
source2 = source.Combine(context.AdditionalTextsProvider.Collect())
1792
var
source = context.SyntaxProvider.CreateSyntaxProvider((c, _) => c is FieldDeclarationSyntax fds, (c, _) =>
1797
var
comparerSource = source.WithComparer(new LambdaComparer<string>((a, b) => false));
1800
var
joinedSource = source.Combine(comparerSource.Collect());
1991
var
step1 = ctx.SyntaxProvider.CreateSyntaxProvider((c, ct) => { filterCalled++; if (c is AssignmentExpressionSyntax) cts.Cancel(); return true; }, (a, _) => a);
2017
var
step1 = ctx.SyntaxProvider.CreateSyntaxProvider((c, ct) => { generatorCancelled = true; cts.Cancel(); return true; }, (a, _) => a);
2020
var
step2 = ctx.SyntaxProvider.CreateSyntaxProvider((c, ct) => { return true; }, (a, _) => a);
Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler (1)
GeneratorExtensions.cs (1)
20
public static void RegisterHostOutput<TSource>(ref this IncrementalGeneratorInitializationContext @this,
IncrementalValuesProvider
<TSource> source, Action<HostProductionContext, TSource, CancellationToken> action)
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\CompileTimeSolutionProviderTests.cs (1)
88
var
sources = context.AdditionalTextsProvider.Combine(isDisabled).Select((pair, ct) =>
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
AbstractResxGenerator.cs (3)
38
var
resourceFiles = context.AdditionalTextsProvider.Where(static file => file.Path.EndsWith(".resx", StringComparison.OrdinalIgnoreCase));
53
var
resourceFilesToGenerateSource = resourceFiles.Combine(context.AnalyzerConfigOptionsProvider.Combine(compilationInformation)).SelectMany(
177
var
resourceFilesToGenerateSourceWithNames = resourceFilesToGenerateSource.Combine(renameMapping).Select(
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.vb (2)
17
context As IncrementalGeneratorInitializationContext, simpleName As String) As
IncrementalValuesProvider
(Of T)
26
context As IncrementalGeneratorInitializationContext, fullyQualifiedMetadataName As String) As
IncrementalValuesProvider
(Of T)
Microsoft.Extensions.Options.SourceGeneration (1)
Generator.cs (1)
20
IncrementalValuesProvider
<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)> typeDeclarations = context.SyntaxProvider
Microsoft.Extensions.Validation.ValidationsGenerator (10)
Extensions\IncrementalValuesProviderExtensions.cs (5)
13
public static
IncrementalValuesProvider
<TSource> Distinct<TSource>(this
IncrementalValuesProvider
<TSource> source, IEqualityComparer<TSource> comparer)
40
public static
IncrementalValuesProvider
<T> Concat<T>(
41
this
IncrementalValuesProvider
<ImmutableArray<T>> first,
42
IncrementalValuesProvider
<ImmutableArray<T>> second)
ValidationsGenerator.cs (5)
15
var
addValidation = context.SyntaxProvider.CreateSyntaxProvider(
20
var
validatableTypesWithAttribute = context.SyntaxProvider.ForAttributeWithMetadataName(
26
var
endpoints = context.SyntaxProvider
32
var
validatableTypesFromEndpoints = endpoints
40
var
emitInputs = addValidation
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Gen.ContextualOptions (2)
ContextualOptionsGenerator.cs (1)
18
IncrementalValuesProvider
<SyntaxNode> typeDeclarations = context.SyntaxProvider
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Gen.Logging (2)
LoggingGenerator.cs (1)
19
IncrementalValuesProvider
<TypeDeclarationSyntax> typeDeclarations = context.SyntaxProvider
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Gen.Metrics (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
63
var
declarations = context.SyntaxProvider
Microsoft.Interop.ComInterfaceGenerator (37)
ComClassGenerator.cs (5)
23
var
attributedClassesOrDiagnostics = context.SyntaxProvider
38
var
attributedClasses = context.FilterAndReportDiagnostics(attributedClassesOrDiagnostics);
40
var
className = attributedClasses.Select(static (info, ct) => info.ClassName);
42
var
classInfoType = attributedClasses
46
var
attribute = attributedClasses
ComInterfaceGenerator.cs (22)
38
var
attributedInterfaces = context.SyntaxProvider
48
var
interfaceSymbolOrDiagnostics = attributedInterfaces.Combine(stubEnvironment).Select(static (data, ct) =>
52
var
interfaceSymbolsToGenerateWithoutDiagnostics = context.FilterAndReportDiagnostics(interfaceSymbolOrDiagnostics);
54
var
externalInterfaceSymbols = attributedInterfaces.SelectMany(static (data, ct) =>
59
var
interfaceSymbolsWithoutDiagnostics = interfaceSymbolsToGenerateWithoutDiagnostics.Concat(externalInterfaceSymbols);
61
var
interfaceContextsOrDiagnostics = interfaceSymbolsWithoutDiagnostics
67
(
var
interfaceContexts, interfaceSymbolsWithoutDiagnostics) = context.FilterAndReportDiagnostics(interfaceContextsOrDiagnostics, interfaceSymbolsWithoutDiagnostics);
69
var
comMethodsAndSymbolsOrDiagnostics = interfaceSymbolsWithoutDiagnostics.Select(ComMethodInfo.GetMethodsFromInterface);
70
var
methodInfoAndSymbolGroupedByInterface = context
73
var
methodInfosGroupedByInterface = methodInfoAndSymbolGroupedByInterface
77
var
comMethodContextBuilders = interfaceContexts
94
var
interfaceContextsToGenerate = interfaceContexts.Where(context => !context.IsExternallyDefined);
101
var
comMethodContexts = comMethodContextBuilders
113
var
interfaceAndMethodsContexts = comMethodContexts
119
var
managedToNativeInterfaceImplementations = interfaceAndMethodsContexts
126
var
nativeToManagedVtableStructs = interfaceAndMethodsContexts
132
var
nativeToManagedVtableMethods = interfaceAndMethodsContexts
144
var
nativeInterfaceInformation = interfaceContextsToGenerate
151
var
shadowingMethodDeclarations = interfaceAndMethodsContexts
168
var
nativeToManagedVtables = interfaceAndMethodsContexts
174
var
iUnknownDerivedAttributeApplication = interfaceContextsToGenerate
181
var
filesToGenerate = interfaceContextsToGenerate
VtableIndexStubGenerator.cs (10)
38
var
attributedMethods = context.SyntaxProvider
48
var
methodsWithDiagnostics = attributedMethods.Select(static (data, ct) =>
55
var
methodsToGenerate = methodsWithDiagnostics.Where(static data => data.Diagnostic is null);
56
var
invalidMethodDiagnostics = methodsWithDiagnostics.Where(static data => data.Diagnostic is not null);
65
IncrementalValuesProvider
<IncrementalMethodStubGenerationContext> generateStubInformation = methodsToGenerate
79
IncrementalValuesProvider
<(MemberDeclarationSyntax, ImmutableArray<DiagnosticInfo>)> generateManagedToNativeStub = generateStubInformation
92
IncrementalValuesProvider
<IncrementalMethodStubGenerationContext> nativeToManagedStubContexts =
97
IncrementalValuesProvider
<(MemberDeclarationSyntax, ImmutableArray<DiagnosticInfo>)> generateNativeToManagedStub = nativeToManagedStubContexts
109
IncrementalValuesProvider
<MemberDeclarationSyntax> generateNativeInterface = generateStubInformation
120
IncrementalValuesProvider
<MemberDeclarationSyntax> populateVTable =
Microsoft.Interop.JavaScript.JSImportGenerator (10)
JSExportGenerator.cs (5)
40
var
attributedMethods = context.SyntaxProvider
46
var
methodsWithDiagnostics = attributedMethods.Select(static (data, ct) =>
52
var
methodsToGenerate = methodsWithDiagnostics.Where(static data => data.Diagnostic is null);
53
var
invalidMethodDiagnostics = methodsWithDiagnostics.Where(static data => data.Diagnostic is not null);
75
IncrementalValuesProvider
<(MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, ImmutableArray<DiagnosticInfo>)> generateSingleStub = methodsToGenerate
JSImportGenerator.cs (5)
41
var
attributedMethods = context.SyntaxProvider
47
var
methodsWithDiagnostics = attributedMethods.Select(static (data, ct) =>
53
var
methodsToGenerate = methodsWithDiagnostics.Where(static data => data.Diagnostic is null);
54
var
invalidMethodDiagnostics = methodsWithDiagnostics.Where(static data => data.Diagnostic is not null);
76
IncrementalValuesProvider
<(MemberDeclarationSyntax, ImmutableArray<DiagnosticInfo>)> generateSingleStub = methodsToGenerate
Microsoft.Interop.LibraryImportGenerator (4)
LibraryImportGenerator.cs (4)
43
var
attributedMethods = context.SyntaxProvider
54
var
methodsWithDiagnostics = attributedMethods.Select(static (data, ct) =>
62
var
methodsToGenerate = context.FilterAndReportDiagnostics(methodsWithDiagnostics);
86
IncrementalValuesProvider
<(MemberDeclarationSyntax, ImmutableArray<DiagnosticInfo>)> generateSingleStub = methodsToGenerate
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
DownlevelLibraryImportGenerator.cs (4)
42
var
attributedMethods = context.SyntaxProvider
53
var
methodsWithDiagnostics = attributedMethods.Select(static (data, ct) =>
61
var
methodsToGenerate = context.FilterAndReportDiagnostics(methodsWithDiagnostics);
65
IncrementalValuesProvider
<(MemberDeclarationSyntax, ImmutableArray<DiagnosticInfo>)> generateSingleStub = methodsToGenerate
Microsoft.Interop.SourceGeneration (39)
DiagnosticOr.cs (25)
119
public static (
IncrementalValuesProvider
<T>,
IncrementalValuesProvider
<DiagnosticInfo>) Split<T>(this
IncrementalValuesProvider
<DiagnosticOr<T>> provider)
121
var
values = provider.Where(x => x.HasValue).Select(static (x, ct) => x.Value);
122
var
diagnostics = provider.Where(x => x.HasDiagnostic).SelectMany(static (x, ct) => x.Diagnostics);
129
public static (
IncrementalValuesProvider
<SequenceEqualImmutableArray<T>>,
IncrementalValuesProvider
<DiagnosticInfo>) SplitArrays<T>(this
IncrementalValuesProvider
<SequenceEqualImmutableArray<DiagnosticOr<T>>> provider)
131
var
values = provider.Select((arr, ct) => arr.Where(x => x.HasValue).Select((x, ct) => x.Value).ToSequenceEqualImmutableArray());
132
var
diagnostics = provider.SelectMany((arr, ct) => arr.Where(x => x.HasDiagnostic).SelectMany((x, ct) => x.Diagnostics));
139
public static (
IncrementalValuesProvider
<(T, T2)>,
IncrementalValuesProvider
<DiagnosticInfo>) Split<T, T2>(this
IncrementalValuesProvider
<(DiagnosticOr<T>, T2)> provider)
141
var
values = provider.Where(x => x.Item1.HasValue).Select(static (x, ct) => (x.Item1.Value, x.Item2));
142
var
diagnostics = provider.Where(x => x.Item1.HasDiagnostic).SelectMany(static (x, ct) => x.Item1.Diagnostics);
147
/// Filters the <see cref="
IncrementalValuesProvider
{TValue}"/> by whether or not the is a <see cref="Diagnostic"/>, reports the diagnostics, and returns the values.
149
public static
IncrementalValuesProvider
<T> FilterAndReportDiagnostics<T>(this IncrementalGeneratorInitializationContext ctx,
IncrementalValuesProvider
<DiagnosticOr<T>> diagnosticOrValues)
157
/// Filters both <see cref="
IncrementalValuesProvider
{TValue}"/> by whether or not the value in <paramref name="diagnosticOrValues"/> is a <see cref="Diagnostic"/>, reports the diagnostics, and returns the values.
159
public static (
IncrementalValuesProvider
<T>,
IncrementalValuesProvider
<T2>) FilterAndReportDiagnostics<T, T2>(
161
IncrementalValuesProvider
<DiagnosticOr<T>> diagnosticOrValues,
162
IncrementalValuesProvider
<T2> associatedValues)
172
public static
IncrementalValuesProvider
<SequenceEqualImmutableArray<T>> FilterAndReportDiagnostics<T>(
174
IncrementalValuesProvider
<SequenceEqualImmutableArray<DiagnosticOr<T>>> diagnosticOrValues)
IncrementalGeneratorInitializationContextExtensions.cs (3)
53
public static void RegisterDiagnostics(this IncrementalGeneratorInitializationContext context,
IncrementalValuesProvider
<DiagnosticInfo> diagnostics)
61
public static void RegisterDiagnostics(this IncrementalGeneratorInitializationContext context,
IncrementalValuesProvider
<Diagnostic> diagnostics)
69
public static void RegisterConcatenatedSyntaxOutputs<TNode>(this IncrementalGeneratorInitializationContext context,
IncrementalValuesProvider
<TNode> nodes, string fileName)
IncrementalValuesProviderExtensions.cs (11)
12
public static
IncrementalValuesProvider
<(T Left, U Right)> Zip<T, U>(this
IncrementalValuesProvider
<T> left,
IncrementalValuesProvider
<U> right)
44
public static
IncrementalValuesProvider
<TNode> SelectNormalized<TNode>(this
IncrementalValuesProvider
<TNode> provider)
50
public static (
IncrementalValuesProvider
<T>,
IncrementalValuesProvider
<T2>) Split<T, T2>(this
IncrementalValuesProvider
<(T, T2)> provider)
55
public static
IncrementalValuesProvider
<T> Concat<T>(this
IncrementalValuesProvider
<T> first,
IncrementalValuesProvider
<T> second)
Microsoft.Maui.Controls.BindingSourceGen (2)
BindingSourceGenerator.cs (2)
18
var
bindingsWithDiagnostics = context.SyntaxProvider.CreateSyntaxProvider(
32
var
bindings = bindingsWithDiagnostics
Microsoft.Maui.Controls.SourceGen (4)
CodeBehindGenerator.cs (4)
42
var
projectItemProvider = initContext.AdditionalTextsProvider
47
var
xamlProjectItemProvider = projectItemProvider
52
var
cssProjectItemProvider = projectItemProvider
69
var
xamlSourceProvider = xamlProjectItemProvider
System.Private.CoreLib.Generators (4)
EventSourceGenerator.cs (1)
40
IncrementalValuesProvider
<EventSourceClass> eventSourceClasses =
NativeRuntimeEventSourceGenerator.cs (3)
21
IncrementalValuesProvider
<AdditionalText> manifestFiles = context.AdditionalTextsProvider.Where(f => f.Path.EndsWith(".man", StringComparison.OrdinalIgnoreCase));
22
IncrementalValuesProvider
<AdditionalText> inclusionFiles = context.AdditionalTextsProvider.Where(f => f.Path.EndsWith(".lst", StringComparison.OrdinalIgnoreCase));
24
IncrementalValuesProvider
<(AdditionalText Left, System.Collections.Immutable.ImmutableArray<AdditionalText> Right)> combined = manifestFiles.Combine(inclusionFiles.Collect());
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Roslyn4.0.cs (1)
34
IncrementalValuesProvider
<(ContextGenerationSpec?, ImmutableEquatableArray<DiagnosticInfo>)> contextGenerationSpecs = context.SyntaxProvider
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (1)
77
IncrementalValuesProvider
<string?> syntaxProvider = context.SyntaxProvider.CreateSyntaxProvider(
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
40
IncrementalValuesProvider
<SyntaxNode> argumentsToValidate = context.SyntaxProvider.CreateSyntaxProvider(
74
IncrementalValuesProvider
<EnumValidationInfo> enumsToValidate = context.CompilationProvider.Combine(argumentsToValidate.Collect()).SelectMany(