Open sandboxFocus

Class AspectWeaverContext

Context for the IAspectWeaver.

Inheritance
AspectWeaverContext
Namespace: Metalama.Framework.Engine.AspectWeavers
Assembly: Metalama.Framework.Sdk.dll
Syntax
[CompileTime]
public sealed class AspectWeaverContext

Properties

Name Description
AspectClass

Gets the type of aspects that must be handled.

AspectInstances

Gets the set of aspect instances that must be weaved.

CancellationToken
Compilation

Gets or sets the compilation.

CompilationServices
GeneratedCodeAnnotation

Gets the annotation with which code generated by the aspect must be annotated. To mark a node, the WithGeneratedCodeAnnotation(SyntaxToken, SyntaxAnnotation) method must be called.

Project

Gets the current project.

ServiceProvider

Methods

Name Description
GetOptions<T>(ISymbol)
ReportDiagnostic(Diagnostic)

Reports a Diagnostic.

RewriteAspectTargetsAsync(CSharpSyntaxRewriter, CancellationToken)

Rewrites the syntax nodes targeted by aspects using a thread-safe CSharpSyntaxRewriter.

RewriteSyntaxTreesAsync(CSharpSyntaxRewriter, CancellationToken)

Rewrites all syntax trees in the compilation using a shared and thread-safe CSharpSyntaxRewriter.

RewriteSyntaxTreesAsync(Func<SyntaxNode, CSharpSyntaxRewriter>, CancellationToken)

Rewrites all syntax trees in the compilation.

Extension Methods