Skip to main content

serve

Function serve 

Source
pub fn serve(connection: &Connection) -> Result<()>
Expand description

Performs initialization, then publishes source/module diagnostics until shutdown.

Reads the caller-owned moduleSources wire snapshot described in the crate documentation, and accepts complete configuration replacements.

Exposed separately from run so tests can drive an in-memory [Connection::memory] pair instead of real stdio.

§Errors

Returns an error if initialization, shutdown or transport communication fails.

  • Complexity: cumulative message dispatch, source analysis and serialization time; space for the current source snapshot and its analysis.

§Examples

let (server, _client) = lsp_server::Connection::memory();
adam_lsp::serve(&server)?;