Skip to main content

Crate oxicode_lsp

Crate oxicode_lsp 

Source
Expand description

oxicode-lsp — Thin LSP protocol adapter.

This crate wraps async_lsp + lsp_types + async_process to provide a single LspClient that owns a language server process and a JSON-RPC correlation loop. It does not do:

  • config discovery / layering (user > project > plugin)
  • folder-trust gating (project lsp.json skipped in untrusted folders)
  • crash recovery / lifetime restart budget
  • multi-server lifecycle / extension conflict resolution

Those concerns belong in oxicode-cli's LSP adapter (see oxicode-cli/src/lsp/manager.rs). Keeping oxicode-lsp thin lets the adapter own policy without re-implementing the JSON-RPC loop.

§Pattern

Ported from grok’s LspManager (see docs/designs/2026-07-18-stub-completion.md §2): a single LspClient per server, with diagnostics_ready: Arc<Notify> gating drain_diagnostics, and lifecycle_id: AtomicU64 marking restart epochs so cached diagnostics from a dead epoch can be evicted.

Structs§

LspClient
One process-spawned language server.
LspClientConfig
Process-handle and runtime knobs for one LSP server.
PublishedDiagnostics
Per-file textDocument/publishDiagnostics snapshot.
ReplayState
Tracked-document replay helper used by oxicode-cli's restart monitor.

Enums§

AsyncLspError
Possible errors.
LspError
Crate-wide error type.

Constants§

REQUEST_TIMEOUT
Default timeout for an individual request → response RPC.

Functions§

uri_for
Helper: build a file:// URI from a path.