Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 687 Bytes

customMarkupSyntax.md

File metadata and controls

22 lines (14 loc) · 687 Bytes

Custom Diagnostic Markup Syntax

Microsoft.CodeAnalysis.Testing

Implicit Expected Diagnostic ID

The markup syntax for the style is extended to also support not explicitly specifying the tested diagnostic ID, and implying it from the TestedDiagnosticRule property in an analyzer test fixture.

The syntax is as follows:

{|*:<node>|}

Where <node> contains the syntax node that the diagnostic will be reported on.

For example, this is how to declare expecting a reported diagnostic on the type of the declared variable:

{|*:int|} number = 1;

The specific expected diagnostic depends on the TestedDiagnosticRule property.