MetalamaAPI documentationAdvanced APIMetalama.​Framework.​Engine.​Code­ModelPartial­Compilation­ExtensionsUpdate­Syntax­Trees
Open sandboxFocus

PartialCompilationExtensions.UpdateSyntaxTrees Method

UpdateSyntaxTrees(IPartialCompilation, Func<SyntaxTree, CancellationToken, SyntaxTree>, CancellationToken)

Updates the syntax trees of a given IPartialCompilation by providing a function that maps a SyntaxTree to a transformed SyntaxTree.

Declaration
public static IPartialCompilation UpdateSyntaxTrees(this IPartialCompilation compilation, Func<SyntaxTree, CancellationToken, SyntaxTree> updateTree, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IPartialCompilation compilation
Func<SyntaxTree, CancellationToken, SyntaxTree> updateTree

A function that maps the old SyntaxTree to the new SyntaxTree.

CancellationToken cancellationToken
Returns
Type Description
IPartialCompilation

A new IPartialCompilation.

UpdateSyntaxTrees(IPartialCompilation, Func<SyntaxNode, CancellationToken, SyntaxNode>, CancellationToken)

Updates the syntax trees of a given IPartialCompilation by providing a function that maps a SyntaxTree to a transformed SyntaxTree.

Declaration
public static IPartialCompilation UpdateSyntaxTrees(this IPartialCompilation compilation, Func<SyntaxNode, CancellationToken, SyntaxNode> updateSyntaxRoot, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IPartialCompilation compilation
Func<SyntaxNode, CancellationToken, SyntaxNode> updateSyntaxRoot

A function that maps the old root SyntaxNode to the new SyntaxNode.

CancellationToken cancellationToken
Returns
Type Description
IPartialCompilation

A new IPartialCompilation.

UpdateSyntaxTrees(IPartialCompilation, Func<SyntaxTree, SyntaxTree>, CancellationToken)

Declaration
public static IPartialCompilation UpdateSyntaxTrees(this IPartialCompilation compilation, Func<SyntaxTree, SyntaxTree> updateTree, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IPartialCompilation compilation
Func<SyntaxTree, SyntaxTree> updateTree
CancellationToken cancellationToken
Returns
Type Description
IPartialCompilation