WithGeneratedCodeAnnotation(SyntaxToken, SyntaxAnnotation)
Annotates a syntax node with an annotation meaning that the syntax node and all its children are generated. The annotation is typically obtained from GeneratedCodeAnnotation, but it can also be created from CreateGeneratedCodeAnnotation(string).
Declaration
public static SyntaxToken WithGeneratedCodeAnnotation(this SyntaxToken node, SyntaxAnnotation annotation)Parameters
| Type | Name | Description |
|---|---|---|
| SyntaxToken | node | The input node. |
| SyntaxAnnotation | annotation | A SyntaxAnnotation of kind GeneratedCodeAnnotationKind. |
Returns
| Type | Description |
|---|---|
| SyntaxToken | The annotated node. |
WithGeneratedCodeAnnotation<T>(T?, SyntaxAnnotation)
Annotates a syntax node with an annotation meaning that the syntax node and all its children are generated, except whose marked with WithSourceCodeAnnotation<T>(T?). The annotation is typically obtained from GeneratedCodeAnnotation, but it can also be created from CreateGeneratedCodeAnnotation(string).
Declaration
public static T? WithGeneratedCodeAnnotation<T>(this T? node, SyntaxAnnotation annotation) where T : SyntaxNodeParameters
| Type | Name | Description |
|---|---|---|
| T | node | The input node. |
| SyntaxAnnotation | annotation | A SyntaxAnnotation of kind GeneratedCodeAnnotationKind. |
Returns
| Type | Description |
|---|---|
| T | The annotated node. |
Type Parameters
| Name | Description |
|---|---|
| T |
WithGeneratedCodeAnnotation(in SyntaxTrivia, SyntaxAnnotation)
Annotates a syntax trivia with an annotation meaning that it is generated code.
Declaration
public static SyntaxTrivia WithGeneratedCodeAnnotation(this in SyntaxTrivia trivia, SyntaxAnnotation annotation)Parameters
| Type | Name | Description |
|---|---|---|
| SyntaxTrivia | trivia | The trivia to annotate. |
| SyntaxAnnotation | annotation | The generated code annotation, typically from GeneratedCodeAnnotation. |
Returns
| Type | Description |
|---|---|
| SyntaxTrivia | The annotated trivia. |