Metalama 1.0 / / Metalama Documentation / Advanced API / Metalama.​Framework.​Engine.​Formatting / Formatting­Annotations

Class FormattingAnnotations

Exposes the SyntaxAnnotations used by Metalama.

Inheritance
FormattingAnnotations
Namespace: Metalama.Framework.Engine.Formatting
Assembly: Metalama.Framework.Sdk.dll
Syntax
public static class FormattingAnnotations : Object

Fields

Name Description
PossibleRedundantAnnotation

Annotation used to mark locals and 'return;' statement that may be redundant. Currently we are not doing anything with them, but we could.

Properties

Name Description
SourceCodeAnnotation

Gets an annotation that means that the syntax stems from source code. This can be added to a child node of a node annotated with the WithGeneratedCodeAnnotation method. This is a synonym for SourceCodeAnnotation.

Methods

Name Description
WithFormattingAnnotationsFrom<T>(T, SyntaxNode)
WithGeneratedCodeAnnotation(SyntaxToken, SyntaxAnnotation)
WithGeneratedCodeAnnotation<T>(T, SyntaxAnnotation)
WithSimplifierAnnotation<T>(T)
WithSourceCodeAnnotation<T>(T)

Annotates a syntax node with an annotation meaning that the syntax node and all its children are user code. The annotation is typically obtained from GeneratedCodeAnnotation, but it can also be created from CreateGeneratedCodeAnnotation(String).

WithSourceCodeAnnotationIfNotGenerated<T>(T)