Open sandboxFocus

Method WithSourceCodeAnnotationIfNotGenerated

WithSourceCodeAnnotationIfNotGenerated<T>(T)

Marks a syntax node as source code only if it is not already marked as generated code.

Declaration
public static T WithSourceCodeAnnotationIfNotGenerated<T>(this T node) where T : SyntaxNode
Parameters
Type Name Description
T node

The node to potentially mark.

Returns
Type Description
T

The node with the source code annotation if not already generated; otherwise, the original node.

Type Parameters
Name Description
T

The type of syntax node.