PreCompilationSourceProductionContext Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Context passed to an incremental generator when it has registered an output via RegisterPreCompilationSourceOutput<TSource>(IncrementalValueProvider<TSource>, Action<PreCompilationSourceProductionContext,TSource>). Pre-compilation source outputs execute before the compilation is available and can only add source files, not report diagnostics.
public readonly struct PreCompilationSourceProductionContext
type PreCompilationSourceProductionContext = struct
Public Structure PreCompilationSourceProductionContext
- Inheritance
-
PreCompilationSourceProductionContext
Properties
| Name | Description |
|---|---|
| CancellationToken |
A CancellationToken that can be checked to see if the generation should be cancelled. |
Methods
| Name | Description |
|---|---|
| AddSource(String, SourceText) |
Adds a SourceText to the compilation |
| AddSource(String, String) |
Adds source code in the form of a String to the compilation. |