Diagnostic status carried by a semantic file-tree row.
Rows keep diagnostic counts separate from dirty and git state so renderers can show each status independently without re-querying LSP or diagnostics state.
Summary
Functions
Returns the count for a severity.
Returns an empty diagnostic status.
Returns the highest severity represented by the counts.
Merges two diagnostic count sets.
Builds diagnostic status from a count tuple, map, keyword list, or existing struct.
Returns counts as the file-tree wire tuple.
Returns the total number of diagnostics.
Types
@type counts() :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
@type severity() :: :error | :warning | :info | :hint
@type t() :: %MingaEditor.FileTree.Diagnostics{ error_count: non_neg_integer(), hint_count: non_neg_integer(), info_count: non_neg_integer(), warning_count: non_neg_integer() }
Functions
@spec count_for(t(), severity()) :: non_neg_integer()
Returns the count for a severity.
@spec empty() :: t()
Returns an empty diagnostic status.
Returns the highest severity represented by the counts.
@spec merge( t() | counts() | map() | keyword() | nil, t() | counts() | map() | keyword() | nil ) :: t()
Merges two diagnostic count sets.
Builds diagnostic status from a count tuple, map, keyword list, or existing struct.
Returns counts as the file-tree wire tuple.
@spec total_count(t()) :: non_neg_integer()
Returns the total number of diagnostics.