English
Each example is a runnable stdio language server. The parsers are deliberately small, so the protocol interaction stays visible.
Run an example
console
cargo run -p lspf --example hoverThe process waits for an LSP client on stdin. In this repository, run Run LSP example client (select example) from VS Code to open an Extension Development Host connected to the selected server.
Every example logs to stderr because stdout carries the LSP wire protocol. RUST_LOG selects the events—use RUST_LOG=lspf=trace for the full framework trace—and LSPF_LOG_FORMAT=json writes one machine-readable event per line. Any other format value produces plain text.
Language features
| Example | What it demonstrates |
|---|---|
code_actions | Code actions |
code_lens | Code lens, resolve, commands, and workspace edits |
colors | Document colors and color presentations |
formatting | Document, range, and on-type formatting |
goto | Declaration, definition, implementation, type definition, and references |
hover | Hover results built from synchronized document text |
inlay_hints | Inlay hints and resolve |
links | Document links and resolve |
publish_diagnostics | Push diagnostics from document hooks |
pull_diagnostics | Document and workspace diagnostic requests |
rename | Prepare rename and rename |
semantic_tokens | Full, delta, and range semantic tokens |
symbols | Document and workspace symbols |
Framework behavior
| Example | What it demonstrates |
|---|---|
server_features | Commands, progress, configuration, async work, and dynamic registration |
blocking_work | Keeping blocking work off async executor threads |
Transport examples
The transport examples reuse the same handlers so application logic does not change with the host:
console
cargo check -p lspf --example native_tcp --no-default-features --features tcp
cargo check -p lspf --example native_websocket --no-default-features --features websocketRun Run LSP example client over a socket (select transport) in VS Code and choose tcp or websocket to start an example and connect the editor's own language client to it. Zed launches language servers over stdio and cannot connect to these socket examples.
For an unattended check of both adapters, run:
console
node tools/lsp-transport-probe/main.mjs bothThe transport guide covers native sockets and browser or Node workers, including build and host commands.