MetalamaAPI documentationAdvanced APIMetalama.​Framework.​Engine.​FormattingFormatting­Annotations
Open sandboxFocus

FormattingAnnotations Class

Exposes the Microsoft.CodeAnalysis.SyntaxAnnotations used by Metalama.

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

Properties

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.

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(in SyntaxTrivia, 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)