# `ExAthena.Lsp.Manager`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/lsp/manager.ex#L1)

Manages one `ExAthena.Lsp.Client` per `{project_root, language}` pair.

Clients are lazily spawned under `ExAthena.Lsp.ClientSupervisor` and
registered in `ExAthena.Lsp.Registry` — the registry is the source of
truth for "is this client running?", not Manager state.

Manager state holds only a `%{monitor_ref => {root, language}}` map for
crash telemetry; pids are always looked up from the Registry.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `client_for_file`

```elixir
@spec client_for_file(String.t(), String.t()) ::
  {:ok, pid()} | {:error, :unsupported_language | term()}
```

Return `{:ok, pid}` for the LSP client that handles files with the
extension of `file`, or `{:error, :unsupported_language}` if the
extension is not mapped.

# `ensure_started`

```elixir
@spec ensure_started(String.t(), atom()) :: {:ok, pid()} | {:error, term()}
```

Return `{:ok, pid}` for the LSP client serving `(project_root, language)`,
spawning one if none is running yet.

# `list`

```elixir
@spec list() :: [%{root: String.t(), language: atom(), pid: pid()}]
```

Return a list of all running clients.

# `start_link`

# `stop`

```elixir
@spec stop(String.t(), atom()) :: :ok
```

Terminate the client for `(project_root, language)` if one is running.

---

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