The main message of this diagnostic.
The source code location where this violation appears, Position.None if not available
String ID for the category of this lint message.
String ID for the category of this lint message.
A linter diagnostic is keyed by two unique values: - the rule name (which is not available in a Diagnostic - the category ID (this value)
The categoryID may be empty, in which case the category of this message will be uniquely defined by the rule name. If a linter rule reports multiple different kinds of diagnostics then it's recommended to provide non-empty categoryID.
An optional detailed explanation of this message.
The severity of this message: error, warning or info
A linter message reporting a code style violation.
It's idiomatic to implement a custom class that extends this trait for each unique category of linting messages. For example, if you have an "unused code" linter then you might want to create a
class UnusedCode extends Diagnostic
class with the appropriate context.Expensive values such as the message and explanation can be computed on-demand.
for a Diagnostic that is associated with a specific rule use scalafix.lint.RuleDiagnostic.