incin_lsp/lib.rs
1//! `incin-lsp` - a transparent LSP proxy that sits between an editor and
2//! rust-analyzer: it spawns rust-analyzer as a child process and rewrites
3//! only the selected diagnostic and type-display messages through
4//! `incin-diagnostics` before forwarding them on:
5//!
6//! - pushed and pulled diagnostics: each message gets its typenum expressions
7//! replaced with decimals and known shape errors gain focused guidance;
8//! - `textDocument/inlayHint` responses: each hint's `label` gets the same
9//! treatment via [`incin_diagnostics::humanize_inlay_label`];
10//! - `textDocument/hover` responses: displayed type signatures are humanized.
11//!
12//! Every other message (completion, goto-definition, formatting, ...) is
13//! forwarded byte-for-byte unchanged - the proxy never re-serializes a
14//! message it isn't rewriting, so it cannot introduce whitespace/key-order
15//! drift on anything it doesn't touch.
16//!
17//! Deliberately does **not** depend on `tower-lsp`/`lsp-types`: modeling the
18//! entire LSP surface would be an ongoing maintenance burden for a proxy
19//! that only needs to understand a small set of message shapes. Frames are
20//! read/written as raw `Content-Length`-prefixed bytes ([`frame`]) and, only
21//! when a rewrite might apply, inspected as [`serde_json::Value`]
22//! ([`rewrite`]) - everything else passes through as opaque bytes.
23
24pub mod config;
25pub mod frame;
26pub mod rewrite;