Method GenerateSourceTextForRootNodes
GenerateSourceTextForRootNodes(String, GeneratorExecutionContext, SyntaxTree, IEnumerable<MemberDeclarationSyntax>)
Generates the SourceText from a given list of root nodes using the SyntaxTree's path. Includes the existing SyntaxTree's root using statements, and adds correct line directives.
Declaration
public static SourceText GenerateSourceTextForRootNodes(string generatorName, GeneratorExecutionContext generatorExecutionContext, SyntaxTree originalSyntaxTree, IEnumerable<MemberDeclarationSyntax> rootNodes)
Parameters
Type | Name | Description |
---|---|---|
String | generatorName | Name to base filepath on. |
GeneratorExecutionContext | generatorExecutionContext | Context of the generator executed. |
SyntaxTree | originalSyntaxTree | Original SyntaxTree to base SourceText location and usings on. |
IEnumerable<MemberDeclarationSyntax> | rootNodes | Root nodes to add to compilation unit. |
Returns
Type | Description |
---|---|
SourceText | The SourceText based on nodes and SyntaxTree filepath. |