# `MingaEditor.FileTree.Diagnostics`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/file_tree/diagnostics.ex#L1)

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.

# `counts`

```elixir
@type counts() ::
  {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
```

# `severity`

```elixir
@type severity() :: :error | :warning | :info | :hint
```

# `t`

```elixir
@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()
}
```

# `count_for`

```elixir
@spec count_for(t(), severity()) :: non_neg_integer()
```

Returns the count for a severity.

# `empty`

```elixir
@spec empty() :: t()
```

Returns an empty diagnostic status.

# `highest_severity`

```elixir
@spec highest_severity(t()) :: severity() | nil
```

Returns the highest severity represented by the counts.

# `merge`

```elixir
@spec merge(
  t() | counts() | map() | keyword() | nil,
  t() | counts() | map() | keyword() | nil
) :: t()
```

Merges two diagnostic count sets.

# `new`

```elixir
@spec new(t() | counts() | map() | keyword() | nil) :: t()
```

Builds diagnostic status from a count tuple, map, keyword list, or existing struct.

# `to_tuple`

```elixir
@spec to_tuple(t()) :: counts()
```

Returns counts as the file-tree wire tuple.

# `total_count`

```elixir
@spec total_count(t()) :: non_neg_integer()
```

Returns the total number of diagnostics.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
