Provides context and services for IAspectWeaver implementations to transform Roslyn compilations.
Namespace: Metalama.Framework.Engine.AspectWeavers
Assembly: Metalama.Framework.Sdk.dll
Syntax
[CompileTime]
public sealed class AspectWeaverContextRemarks
This context is passed to TransformAsync(AspectWeaverContext) and provides:
- AspectInstances: The aspect instances to process (keyed by target ISymbol).
- Compilation: The current IPartialCompilation to read and modify.
- Helper methods like RewriteAspectTargetsAsync(CSharpSyntaxRewriter, CancellationToken) for common transformation patterns.
- GeneratedCodeAnnotation: The annotation to apply to generated syntax nodes.
Formatting: Your weaver does not need to format output code. Metalama handles formatting at the end of the pipeline. However, your weaver must annotate generated nodes using methods from FormattingAnnotations.
Properties
| Name | Description |
|---|---|
| AspectClass | Gets the IAspectClass metadata for the aspect type being processed. |
| AspectInstances | Gets the dictionary of aspect instances that must be processed, keyed by their target ISymbol. |
| CancellationToken | |
| Compilation | Gets or sets the compilation being transformed. |
| CompilationServices | |
| GeneratedCodeAnnotation | Gets the SyntaxAnnotation that must be applied to all code generated by the weaver. |
| Project | Gets the current IProject being compiled. |
| ServiceProvider |