Diagnostic Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a diagnostic, such as a compiler error or a warning, along with the location where it occurred.
public ref class Diagnostic abstract : IEquatable<Microsoft::CodeAnalysis::Diagnostic ^>, IFormattable
[System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(), nq}")]
public abstract class Diagnostic : IEquatable<Microsoft.CodeAnalysis.Diagnostic>, IFormattable
[<System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(), nq}")>]
type Diagnostic = class
interface IEquatable<Diagnostic>
interface IFormattable
Public MustInherit Class Diagnostic
Implements IEquatable(Of Diagnostic), IFormattable
- Inheritance
-
Diagnostic
- Attributes
- Implements
Constructors
Diagnostic() |
Properties
AdditionalLocations |
Gets an array of additional locations related to the diagnostic. Typically these are the locations of other items referenced in the message. |
DefaultSeverity |
Gets the default DiagnosticSeverity of the diagnostic's DiagnosticDescriptor. |
Descriptor |
Gets the diagnostic descriptor, which provides a description about a Diagnostic. |
Id |
Gets the diagnostic identifier. For diagnostics generated by the compiler, this will be a numeric code with a prefix such as "CS1001". |
IsSuppressed |
Returns true if the diagnostic has a source suppression, i.e. an attribute or a pragma suppression. |
IsWarningAsError |
Returns true if this is a warning treated as an error; otherwise false. |
Location |
Gets the primary location of the diagnostic, or None if no primary location. |
Properties |
Gets property bag for the diagnostic. it will return Empty if there is no entry. This can be used to put diagnostic specific information you want to pass around. for example, to corresponding fixer. |
Severity |
Gets the effective DiagnosticSeverity of the diagnostic. |
WarningLevel |
Gets the warning level. This is 0 for diagnostics with severity Error, otherwise an integer greater than zero. |
Methods
Explicit Interface Implementations
IFormattable.ToString(String, IFormatProvider) |