Typle.Diagnostic
(Typle v0.1.0)
View Source
Captures and parses compiler diagnostics for type information.
When the Elixir 1.20 compiler detects a type violation, it emits structured diagnostics containing the given and expected types. This module captures those diagnostics and extracts type data.
Summary
Functions
Compiles the given files and captures any type-related diagnostics.
Captures diagnostics for a single file.
Types
@type diagnostic_info() :: %{ file: String.t(), position: {non_neg_integer(), non_neg_integer()}, message: String.t(), given_type: String.t() | nil, expected_type: String.t() | nil }
Functions
@spec capture([String.t()]) :: {:ok, [diagnostic_info()]} | {:error, term()}
Compiles the given files and captures any type-related diagnostics.
Returns a list of parsed diagnostic info maps.
@spec capture_file(String.t()) :: {:ok, [diagnostic_info()]} | {:error, term()}
Captures diagnostics for a single file.