Open sandboxFocusImprove this doc
  • Article

Namespace Metalama.Framework.Introspection

Overview

This namespace reveals intermediate details of the compilation process, such as the list of aspect classes, aspect instances, advice, transformations, and diagnostics.

This namespace proves useful when troubleshooting an aspect, a fabric, or a set of aspects. It provides details that are not readily apparent from the compilation output.

To begin with this namespace, load your C# project or solution using the Metalama.Framework.Workspaces namespace or with the LINQPad driver. Refer to Inspecting a project using LINQPad for more information.

The entry point of this namespace is the IIntrospectionCompilationDetails interface. This interface is implemented by the Workspace and Project classes.

For example, the following query returns all aspect instances in a project:

workspace.GetProject("Metalama.Samples.Log4", "net8.0").AspectInstances

Class diagram

0..*
0..*
0..*
0..*
0..*
0..*
1
0..*
1
1..*
0..*
0..*
SecondaryInstances
0..*
Transformation
1
0..*
Predecessors
0..*
0..*
Successors
0..*
0..*
IIntrospectionCompilationDetails
IIntrospectionDiagnostic
IIntrospectionAspectClass
IIntrospectionAspectLayer
Id
LayerName
Order
ExplicitOrder
IsDefaultLayer
IIntrospectionAspectInstance
Aspect: IAspect
AspectState: IAspectState
IIntrospectionAdvice
AdviceKind
TargetDeclaration
AspectLayerId
IIntrospectionTransformation
TransformationKind
TargetDeclaration
Description
IntroducedDeclaration
Order
IIntrospectionAspectPredecessor
PredecessorDegree
TargetDeclaration : IDeclaration
IIntrospectionFabric
IIntrospectionAttributeAsPredecessor

Classes

CompilationFailedException

Exception thrown when the compilation failed.

IntrospectionAspectRelationship

Represents the relationship that an object (attribute, fabric, aspect) has created or required another aspect or validator. These relationships are exposed on Predecessors and Successors.

IntrospectionOptions

Structs

IntrospectionReferenceDetail

Interfaces

IIntrospectionAdvice

Represents a piece of advice provided by an aspect.

IIntrospectionAspectClass

Represents an aspect class (i.e. a type of aspect) and exposes all its instances in the current scope.

IIntrospectionAspectInstance

Represents an instance of an aspect, as well as the results of the aspect instance.

IIntrospectionAspectLayer

IIntrospectionAspectPredecessor

Base interface for objects that can cause aspects to be added to a compilation. Predecessors are exposed on the Predecessors property.

IIntrospectionAttributeAsPredecessor

Wraps an IAttribute (which represents a custom attribute) into a IIntrospectionAspectPredecessor.

IIntrospectionCompilationDetails

Exposes the compilation results but not the transformed source code.

IIntrospectionCompilationResult

Represents the result of the processing of a compilation by Metalama.

IIntrospectionDiagnostic

Represents a diagnostic (error, warning, information, hidden message).

IIntrospectionFabric

Represents a fabric.

IIntrospectionReference

IIntrospectionReferenceGraph

IIntrospectionTransformation

Represents a code transformation.

IProjectIntrospectionService

Enums

IntrospectionChildKinds

IntrospectionDiagnosticSource

Enumerates the possible sources (or originators) of an IIntrospectionDiagnostic.

IntrospectionTransformationKind