View Source Mix.Task.Compiler.Diagnostic (Mix v1.15.0)

Diagnostic information such as a warning or compilation error.

Link to this section Summary

Types

Where in a file the diagnostic applies. Can be either a line number, a {line, column} tuple, a range specified as {start_line, start_col, end_line, end_col}. 0 line represents unknown.

Severity of a diagnostic

t()

Link to this section Types

Where in a file the diagnostic applies. Can be either a line number, a {line, column} tuple, a range specified as {start_line, start_col, end_line, end_col}. 0 line represents unknown.

Line numbers are one-based, and column numbers in a range are zero-based and refer to the cursor position at the start of the character at that index. For example, to indicate that a diagnostic applies to the first n characters of the first line, the range would be {1, 0, 1, n}.

@type severity() :: :error | :warning | :information | :hint

Severity of a diagnostic:

  • :error - An issue that caused compilation to fail

  • :warning - An issue that did not cause failure but suggests the programmer may have made a mistake

  • :hint - A suggestion for style or good practices that is not as severe as a warning

  • :information - Any other information relevant to compilation that does not fit into the above categories

@type t() :: %Mix.Task.Compiler.Diagnostic{
  compiler_name: String.t(),
  details: any(),
  file: Path.t(),
  message: IO.chardata(),
  position: position(),
  severity: severity(),
  stacktrace: Exception.stacktrace()
}