MetalamaAPI documentationAdvanced APIMetalama.​CompilerMetalama­Compiler­Annotations
Open sandboxFocus

MetalamaCompilerAnnotations Class

Exposes the Microsoft.CodeAnalysis.SyntaxAnnotations used by Metalama.Compiler.

Inheritance
System.Object
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
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 Microsoft.CodeAnalysis.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 Microsoft.CodeAnalysis.SyntaxAnnotation to a node that maps the node to the location of another node in source code.

WithRedirectCodeCoverageAnnotation<T>(T, ISymbol)