Open sandboxFocus

Class MetalamaCompilerAnnotations

Exposes the SyntaxAnnotations used by Metalama.Compiler.

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

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
IncludeInReferenceAssemblyAnnotation

Gets an annotation that means that the declaration of the target syntax node should be included in a reference assembly, even if it otherwise wouldn't be due to its accessibility.

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)
WithIncludeInReferenceAssemblyAnnotation<T>(T)

Adds an annotation that means that the declaration of the target syntax node should be included in a reference assembly, even if it otherwise wouldn't be due to its accessibility.

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)