Share via


SyntaxValueProvider.CreateSyntaxProvider<T> Method

Definition

Creates an IncrementalValueProvider<TValue> that can provide a transform over SyntaxNodes

public Microsoft.CodeAnalysis.IncrementalValuesProvider<T> CreateSyntaxProvider<T> (Func<Microsoft.CodeAnalysis.SyntaxNode,System.Threading.CancellationToken,bool> predicate, Func<Microsoft.CodeAnalysis.GeneratorSyntaxContext,System.Threading.CancellationToken,T> transform);
member this.CreateSyntaxProvider : Func<Microsoft.CodeAnalysis.SyntaxNode, System.Threading.CancellationToken, bool> * Func<Microsoft.CodeAnalysis.GeneratorSyntaxContext, System.Threading.CancellationToken, 'T> -> Microsoft.CodeAnalysis.IncrementalValuesProvider<'T>
Public Function CreateSyntaxProvider(Of T) (predicate As Func(Of SyntaxNode, CancellationToken, Boolean), transform As Func(Of GeneratorSyntaxContext, CancellationToken, T)) As IncrementalValuesProvider(Of T)

Type Parameters

T

The type of the value the syntax node is transformed into

Parameters

predicate
Func<SyntaxNode,CancellationToken,Boolean>

A function that determines if the given SyntaxNode should be transformed

transform
Func<GeneratorSyntaxContext,CancellationToken,T>

A function that performs the transform, when predicatereturns true for a given node

Returns

An IncrementalValueProvider<TValue> that provides the results of the transformation

Applies to