Metalama 1.0 / / Metalama Documentation / Advanced API / Metalama.​Compiler / Metalama­Compiler­Annotations

Class MetalamaCompilerAnnotations

Exposes the SyntaxAnnotations used by Metalama.Compiler.

Inheritance
MetalamaCompilerAnnotations
Namespace: Metalama.Compiler
Assembly: Metalama.Compiler.Interface.dll
Syntax
public static class MetalamaCompilerAnnotations : Object

Fields

Name Description
GeneratedCodeAnnotationKind

Name of the annotation that means that the code is generated. Metalama.Compiler uses this this annotation to change error messages when they are reported on generated code. Any syntax node under a node annotated with such annotation is considered as generated, unless it is under a node annotated with SourceCodeAnnotation. The annotation data is a human-readable text saying which component generated the code.

Properties

Name Description
SourceCodeAnnotation

Gets an annotation that means that the target syntax nodes and its children are source code, even if there is an annotation of kind GeneratedCodeAnnotationKind in a parent node.

Methods

Name Description
CreateGeneratedCodeAnnotation(String)

Creates a SyntaxAnnotation that can be added to syntax nodes to mean that they have been generated by some component, typically by an aspect.

TryGetCodeCoverageRedirectionFromAnnotation(SyntaxNode, Compilation, out ISymbol)
WithIgnoreCodeCoverageAnnotation<T>(T)
WithOriginalLocationAnnotationFrom<T>(T, SyntaxNode)

Adds a SyntaxAnnotation to a node that maps the node to the location of another node in source code.

WithRedirectCodeCoverageAnnotation<T>(T, ISymbol)