Share via


Diagnostic.Create Method

Definition

Overloads

Create(DiagnosticDescriptor, Location, Object[])

Creates a Diagnostic instance.

Create(DiagnosticDescriptor, Location, IEnumerable<Location>, Object[])

Creates a Diagnostic instance.

Create(DiagnosticDescriptor, Location, ImmutableDictionary<String,String>, Object[])

Creates a Diagnostic instance.

Create(DiagnosticDescriptor, Location, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])

Creates a Diagnostic instance.

Create(DiagnosticDescriptor, Location, DiagnosticSeverity, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])

Creates a Diagnostic instance.

Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)

Creates a Diagnostic instance which is localizable.

Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, Boolean, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)

Creates a Diagnostic instance which is localizable.

Create(DiagnosticDescriptor, Location, Object[])

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance.

public:
 static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, ParamArray messageArgs As Object()) As Diagnostic

Parameters

descriptor
DiagnosticDescriptor

A DiagnosticDescriptor describing the diagnostic

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

messageArgs
Object[]

Arguments to the message of the diagnostic

Returns

The Diagnostic instance.

Applies to

Create(DiagnosticDescriptor, Location, IEnumerable<Location>, Object[])

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance.

public:
 static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, additionalLocations As IEnumerable(Of Location), ParamArray messageArgs As Object()) As Diagnostic

Parameters

descriptor
DiagnosticDescriptor

A DiagnosticDescriptor describing the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

additionalLocations
IEnumerable<Location>

An optional set of additional locations related to the diagnostic. Typically, these are locations of other items referenced in the message. If null, AdditionalLocations will return an empty list.

messageArgs
Object[]

Arguments to the message of the diagnostic.

Returns

The Diagnostic instance.

Applies to

Create(DiagnosticDescriptor, Location, ImmutableDictionary<String,String>, Object[])

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance.

public:
 static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic

Parameters

descriptor
DiagnosticDescriptor

A DiagnosticDescriptor describing the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

properties
ImmutableDictionary<String,String>

An optional set of name-value pairs by means of which the analyzer that creates the diagnostic can convey more detailed information to the fixer. If null, Properties will return Empty.

messageArgs
Object[]

Arguments to the message of the diagnostic.

Returns

The Diagnostic instance.

Applies to

Create(DiagnosticDescriptor, Location, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance.

public:
 static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, additionalLocations As IEnumerable(Of Location), properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic

Parameters

descriptor
DiagnosticDescriptor

A DiagnosticDescriptor describing the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

additionalLocations
IEnumerable<Location>

An optional set of additional locations related to the diagnostic. Typically, these are locations of other items referenced in the message. If null, AdditionalLocations will return an empty list.

properties
ImmutableDictionary<String,String>

An optional set of name-value pairs by means of which the analyzer that creates the diagnostic can convey more detailed information to the fixer. If null, Properties will return Empty.

messageArgs
Object[]

Arguments to the message of the diagnostic.

Returns

The Diagnostic instance.

Applies to

Create(DiagnosticDescriptor, Location, DiagnosticSeverity, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance.

public:
 static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, Microsoft::CodeAnalysis::DiagnosticSeverity effectiveSeverity, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * Microsoft.CodeAnalysis.DiagnosticSeverity * seq<Microsoft.CodeAnalysis.Location> * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, effectiveSeverity As DiagnosticSeverity, additionalLocations As IEnumerable(Of Location), properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic

Parameters

descriptor
DiagnosticDescriptor

A DiagnosticDescriptor describing the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

effectiveSeverity
DiagnosticSeverity

Effective severity of the diagnostic.

additionalLocations
IEnumerable<Location>

An optional set of additional locations related to the diagnostic. Typically, these are locations of other items referenced in the message. If null, AdditionalLocations will return an empty list.

properties
ImmutableDictionary<String,String>

An optional set of name-value pairs by means of which the analyzer that creates the diagnostic can convey more detailed information to the fixer. If null, Properties will return Empty.

messageArgs
Object[]

Arguments to the message of the diagnostic.

Returns

The Diagnostic instance.

Applies to

Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance which is localizable.

public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString title = default, Microsoft.CodeAnalysis.LocalizableString description = default, string helpLink = default, Microsoft.CodeAnalysis.Location location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations = default, System.Collections.Generic.IEnumerable<string> customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string> properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string>? properties = default);
static member Create : string * string * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.DiagnosticSeverity * Microsoft.CodeAnalysis.DiagnosticSeverity * bool * int * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.LocalizableString * string * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * seq<string> * System.Collections.Immutable.ImmutableDictionary<string, string> -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (id As String, category As String, message As LocalizableString, severity As DiagnosticSeverity, defaultSeverity As DiagnosticSeverity, isEnabledByDefault As Boolean, warningLevel As Integer, Optional title As LocalizableString = Nothing, Optional description As LocalizableString = Nothing, Optional helpLink As String = Nothing, Optional location As Location = Nothing, Optional additionalLocations As IEnumerable(Of Location) = Nothing, Optional customTags As IEnumerable(Of String) = Nothing, Optional properties As ImmutableDictionary(Of String, String) = Nothing) As Diagnostic

Parameters

id
String

An identifier for the diagnostic. For diagnostics generated by the compiler, this will be a numeric code with a prefix such as "CS1001".

category
String

The category of the diagnostic. For diagnostics generated by the compiler, the category will be "Compiler".

message
LocalizableString

The diagnostic message text.

severity
DiagnosticSeverity

The diagnostic's effective severity.

defaultSeverity
DiagnosticSeverity

The diagnostic's default severity.

isEnabledByDefault
Boolean

True if the diagnostic is enabled by default

warningLevel
Int32

The warning level, greater than 0 if severity is Warning; otherwise 0.

title
LocalizableString

An optional short localizable title describing the diagnostic.

description
LocalizableString

An optional longer localizable description for the diagnostic.

helpLink
String

An optional hyperlink that provides more detailed information regarding the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

additionalLocations
IEnumerable<Location>

An optional set of additional locations related to the diagnostic. Typically, these are locations of other items referenced in the message. If null, AdditionalLocations will return an empty list.

customTags
IEnumerable<String>

An optional set of custom tags for the diagnostic. See WellKnownDiagnosticTags for some well known tags. If null, Microsoft.CodeAnalysis.Diagnostic.CustomTags will return an empty list.

properties
ImmutableDictionary<String,String>

An optional set of name-value pairs by means of which the analyzer that creates the diagnostic can convey more detailed information to the fixer. If null, Properties will return Empty.

Returns

The Diagnostic instance.

Applies to

Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, Boolean, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)

Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs
Source:
Diagnostic.cs

Creates a Diagnostic instance which is localizable.

public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString title = default, Microsoft.CodeAnalysis.LocalizableString description = default, string helpLink = default, Microsoft.CodeAnalysis.Location location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations = default, System.Collections.Generic.IEnumerable<string> customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string> properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string>? properties = default);
static member Create : string * string * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.DiagnosticSeverity * Microsoft.CodeAnalysis.DiagnosticSeverity * bool * int * bool * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.LocalizableString * string * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * seq<string> * System.Collections.Immutable.ImmutableDictionary<string, string> -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (id As String, category As String, message As LocalizableString, severity As DiagnosticSeverity, defaultSeverity As DiagnosticSeverity, isEnabledByDefault As Boolean, warningLevel As Integer, isSuppressed As Boolean, Optional title As LocalizableString = Nothing, Optional description As LocalizableString = Nothing, Optional helpLink As String = Nothing, Optional location As Location = Nothing, Optional additionalLocations As IEnumerable(Of Location) = Nothing, Optional customTags As IEnumerable(Of String) = Nothing, Optional properties As ImmutableDictionary(Of String, String) = Nothing) As Diagnostic

Parameters

id
String

An identifier for the diagnostic. For diagnostics generated by the compiler, this will be a numeric code with a prefix such as "CS1001".

category
String

The category of the diagnostic. For diagnostics generated by the compiler, the category will be "Compiler".

message
LocalizableString

The diagnostic message text.

severity
DiagnosticSeverity

The diagnostic's effective severity.

defaultSeverity
DiagnosticSeverity

The diagnostic's default severity.

isEnabledByDefault
Boolean

True if the diagnostic is enabled by default

warningLevel
Int32

The warning level, greater than 0 if severity is Warning; otherwise 0.

isSuppressed
Boolean

Flag indicating whether the diagnostic is suppressed by a source suppression.

title
LocalizableString

An optional short localizable title describing the diagnostic.

description
LocalizableString

An optional longer localizable description for the diagnostic.

helpLink
String

An optional hyperlink that provides more detailed information regarding the diagnostic.

location
Location

An optional primary location of the diagnostic. If null, Location will return None.

additionalLocations
IEnumerable<Location>

An optional set of additional locations related to the diagnostic. Typically, these are locations of other items referenced in the message. If null, AdditionalLocations will return an empty list.

customTags
IEnumerable<String>

An optional set of custom tags for the diagnostic. See WellKnownDiagnosticTags for some well known tags. If null, Microsoft.CodeAnalysis.Diagnostic.CustomTags will return an empty list.

properties
ImmutableDictionary<String,String>

An optional set of name-value pairs by means of which the analyzer that creates the diagnostic can convey more detailed information to the fixer. If null, Properties will return Empty.

Returns

The Diagnostic instance.

Applies to