Читати англійською

Поділитися через


IIncrementalGenerator Interface

Definition

The base interface required to implement an incremental generator

C#
public interface IIncrementalGenerator

Remarks

The lifetime of a generator is controlled by the compiler. State should not be stored directly on the generator, as there is no guarantee that the same instance will be used on a subsequent generation pass.

Methods

Initialize(IncrementalGeneratorInitializationContext)

Called to initialize the generator and register generation steps via callbacks on the context

Extension Methods

AsSourceGenerator(IIncrementalGenerator)

Converts an IIncrementalGenerator into an ISourceGenerator object that can be used when constructing a GeneratorDriver

GetGeneratorType(IIncrementalGenerator)

Returns the underlying type of a given generator

Applies to

Продукт Версії
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 4.0.1, 4.1.0, 4.12.2, 4.13.0