Skip to main content

oxicode/lsp/
mod.rs

1//! CLI-side LSP adapter.
2//!
3//! Implements [`oxicode_agent::tools::LspProvider`] by routing actions
4//! to one or more [`oxicode_lsp::LspClient`] instances. The adapter owns
5//! the multi-server lifecycle (per-language servers) and exposes a
6//! single `LspProvider` surface to the agent's `lsp` tool.
7//!
8//! See `docs/designs/2026-07-18-stub-completion.md` §4.3.
9//!
10//! # Scope
11//!
12//! MVP: a static server table mapping file extensions to spawn
13//! commands. The first request for a given extension lazily starts
14//! that server. Crash recovery / lifetime restart budget / folder
15//! trust gating are documented follow-ups (see design doc).
16//!
17//! # Server configuration
18//!
19//! Servers are configured via two sources (in priority order):
20//!
21//! 1. Programmatic: [`CliLspProvider::new`] over a [`LspManager`] built from a
22//!    custom server table (see [`LspManager::new`]).
23//! 2. Default table: `default_servers()` returns `rust-analyzer`
24//!    for `.rs` files when the binary is on `PATH`.
25//!
26//! Settings-file discovery (`.oxicode/lsp.toml`) is intentionally
27//! deferred — the programmatic path is enough for SDK consumers and
28//! the `oxicode` CLI's bootstrap.
29
30pub mod manager;
31pub mod provider;
32
33pub use manager::{LspManager, LspServerConfig};
34pub use provider::CliLspProvider;