IncrementalGeneratorInitializationContext.RegisterPreCompilationSourceOutput Method

Definition

Overloads

Name Description
RegisterPreCompilationSourceOutput<TSource>(IncrementalValueProvider<TSource>, Action<PreCompilationSourceProductionContext,TSource>)

Registers a source output that will execute before the compilation is available. The produced source will be added to the initial compilation, making it visible to subsequent phases and other generators.

RegisterPreCompilationSourceOutput<TSource>(IncrementalValuesProvider<TSource>, Action<PreCompilationSourceProductionContext,TSource>)

Registers a source output that will execute before the compilation is available. The produced source will be added to the initial compilation, making it visible to subsequent phases and other generators.

RegisterPreCompilationSourceOutput<TSource>(IncrementalValueProvider<TSource>, Action<PreCompilationSourceProductionContext,TSource>)

Source:
IncrementalContexts.cs

Registers a source output that will execute before the compilation is available. The produced source will be added to the initial compilation, making it visible to subsequent phases and other generators.

public void RegisterPreCompilationSourceOutput<TSource>(Microsoft.CodeAnalysis.IncrementalValueProvider<TSource> source, Action<Microsoft.CodeAnalysis.PreCompilationSourceProductionContext,TSource> action);
member this.RegisterPreCompilationSourceOutput : Microsoft.CodeAnalysis.IncrementalValueProvider<'Source> * Action<Microsoft.CodeAnalysis.PreCompilationSourceProductionContext, 'Source> -> unit
Public Sub RegisterPreCompilationSourceOutput(Of TSource) (source As IncrementalValueProvider(Of TSource), action As Action(Of PreCompilationSourceProductionContext, TSource))

Type Parameters

TSource

The type of the value provided by the source provider

Parameters

source
IncrementalValueProvider<TSource>

An IncrementalValueProvider<TValue> that provides the input value

action
Action<PreCompilationSourceProductionContext,TSource>

An action that receives a PreCompilationSourceProductionContext and the input value, and can add source files

Remarks

The source value provider must not depend on compilation or syntax node inputs. Attempting to access the compilation or syntax trees during this phase will throw an InvalidOperationException.

Applies to

RegisterPreCompilationSourceOutput<TSource>(IncrementalValuesProvider<TSource>, Action<PreCompilationSourceProductionContext,TSource>)

Source:
IncrementalContexts.cs

Registers a source output that will execute before the compilation is available. The produced source will be added to the initial compilation, making it visible to subsequent phases and other generators.

public void RegisterPreCompilationSourceOutput<TSource>(Microsoft.CodeAnalysis.IncrementalValuesProvider<TSource> source, Action<Microsoft.CodeAnalysis.PreCompilationSourceProductionContext,TSource> action);
member this.RegisterPreCompilationSourceOutput : Microsoft.CodeAnalysis.IncrementalValuesProvider<'Source> * Action<Microsoft.CodeAnalysis.PreCompilationSourceProductionContext, 'Source> -> unit
Public Sub RegisterPreCompilationSourceOutput(Of TSource) (source As IncrementalValuesProvider(Of TSource), action As Action(Of PreCompilationSourceProductionContext, TSource))

Type Parameters

TSource

The type of each value provided by the source provider

Parameters

source
IncrementalValuesProvider<TSource>

An IncrementalValuesProvider<TValues> that provides input values

action
Action<PreCompilationSourceProductionContext,TSource>

An action that receives a PreCompilationSourceProductionContext and an input value, and can add source files

Remarks

The source value provider must not depend on compilation or syntax node inputs. Attempting to access the compilation or syntax trees during this phase will throw an InvalidOperationException.

Applies to