# `Minga.Editing.Completion.Index`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/editing/completion/index.ex#L1)

Provider-aware normalized completion index with bounded deterministic snapshots.

# `t`

```elixir
@type t() :: %Minga.Editing.Completion.Index{
  providers: %{
    required(Minga.Editing.Completion.Item.provider_id()) =&gt;
      Minga.Editing.Completion.Index.Provider.t()
  },
  total_count: non_neg_integer()
}
```

# `all_items`

```elixir
@spec all_items(t()) :: [Minga.Editing.Completion.Item.t()]
```

Returns all indexed items in deterministic order for compatibility callers.

# `empty`

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

Returns an empty completion index.

# `find_item`

```elixir
@spec find_item(t(), Minga.Editing.Completion.Item.id() | nil) ::
  Minga.Editing.Completion.Item.t() | nil
```

Finds one exact stable item identity.

# `from_items`

```elixir
@spec from_items([Minga.Editing.Completion.Item.t()]) :: t()
```

Builds an index from candidates grouped by their provider identity.

# `put_provider`

```elixir
@spec put_provider(
  t(),
  Minga.Editing.Completion.Item.provider_id(),
  [Minga.Editing.Completion.Item.t()],
  boolean()
) :: t()
```

Replaces one provider batch after collapsing true provider-local duplicates.

# `snapshot`

```elixir
@spec snapshot(t(), String.t(), pos_integer()) ::
  Minga.Editing.Completion.Index.Snapshot.t()
```

Returns a bounded deterministic semantic snapshot without building a full match list.

# `snapshot`

```elixir
@spec snapshot(
  t(),
  String.t(),
  pos_integer(),
  Minga.Editing.Completion.Item.id() | nil
) ::
  Minga.Editing.Completion.Index.Snapshot.t()
```

Returns a bounded snapshot that retains a matching selected identity across reranking.

# `update_item`

```elixir
@spec update_item(
  t(),
  Minga.Editing.Completion.Item.id(),
  (Minga.Editing.Completion.Item.t() -&gt;
     Minga.Editing.Completion.Item.t())
) :: t()
```

Updates one exact stable item identity while preserving index ownership.

---

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