SourceGeneratorContext Struct
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 a source generator when Execute(SourceGeneratorContext) is called
public readonly struct SourceGeneratorContext
type SourceGeneratorContext = struct
Public Structure SourceGeneratorContext
- Inheritance
-
SourceGeneratorContext
Additional |
A set of additional non-code text files that can be used by generators. |
Analyzer |
Allows access to options provided by an analyzer config |
Cancellation |
A CancellationToken that can be checked to see if the generation should be cancelled. |
Compilation |
Get the current Compilation at the time of execution. |
Syntax |
If the generator registered an ISyntaxReceiver during initialization, this will be the instance created for this generation pass. |
Add |
Adds a SourceText to the compilation |
Report |
Adds a Diagnostic to the users compilation |
Produkt | Versioner |
---|---|
Roslyn | 3.6.0, 3.7.0 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: