SourceGeneratorContext.AddSource(String, SourceText) Method

Definition

Adds a SourceText to the compilation

C#
public void AddSource(string hintName, Microsoft.CodeAnalysis.Text.SourceText sourceText);

Parameters

hintName
String

An identifier that can be used to reference this source text, must be unique within this generator

sourceText
SourceText

The SourceText to add to the compilation

Applies to

Produkt Versioner
Roslyn 3.6.0, 3.7.0