Provides extension methods for transforming IPartialCompilation instances.
Namespace: Metalama.Framework.Engine.CodeModel
Assembly: Metalama.Framework.Sdk.dll
Syntax
public static class PartialCompilationExtensionsRemarks
These methods simplify common compilation transformation patterns in IAspectWeaver implementations:
- UpdateSyntaxTrees: Transform syntax trees using a delegate.
- RewriteSyntaxTreesAsync: Rewrite using a CSharpSyntaxRewriter.
- AddSyntaxTrees(IPartialCompilation, params SyntaxTree[]): Add new syntax trees.
- GetParseOptions(IPartialCompilation): Get parse options for creating new syntax trees.
All methods process syntax trees in parallel for performance. When using RewriteSyntaxTreesAsync(IPartialCompilation, CSharpSyntaxRewriter, ProjectServiceProvider, CancellationToken) with a shared rewriter, ensure the rewriter is thread-safe.