Skip to main content

Module lsp

Module lsp 

Source
Expand description

CLI-side LSP adapter.

Implements oxicode_agent::tools::LspProvider by routing actions to one or more oxicode_lsp::LspClient instances. The adapter owns the multi-server lifecycle (per-language servers) and exposes a single LspProvider surface to the agent’s lsp tool.

See docs/designs/2026-07-18-stub-completion.md §4.3.

§Scope

MVP: a static server table mapping file extensions to spawn commands. The first request for a given extension lazily starts that server. Crash recovery / lifetime restart budget / folder trust gating are documented follow-ups (see design doc).

§Server configuration

Servers are configured via two sources (in priority order):

  1. Programmatic: CliLspProvider::new over a LspManager built from a custom server table (see LspManager::new).
  2. Default table: default_servers() returns rust-analyzer for .rs files when the binary is on PATH.

Settings-file discovery (.oxicode/lsp.toml) is intentionally deferred — the programmatic path is enough for SDK consumers and the oxicode CLI’s bootstrap.

Re-exports§

pub use manager::LspManager;
pub use manager::LspServerConfig;
pub use provider::CliLspProvider;

Modules§

manager
LSP manager — multi-server lifecycle and config layering.
provider
CLI-side LspProvider implementation — bridges the agent’s lsp tool to super::LspManager.