lspresso
Use existing test helpers and benchmarking tools to validate and performance and correctness!

use ;
let mut client = spawn_initialized?
// default 15s, set to a reasonable upper bound so test timeouts are short
.with_timeout;
let uri: Uri = "hi.json".parse?;
// convenience methods provide a simpler API
client.did_open?;
// for example, `Client::diagnostics` pulls when the server supports it and
// waits for pushed diagnostics otherwise
let diags = client.diagnostics?;
assert_eq!;
// if you need lower level control, import the `Protocol` trait
// each method is prefixed with `protocol_` to differentiate from the
// convenience layer
use Protocol as _;
// pull diagnostics
let diags = client.protocol_diagnostic?;
// push diagnostics wait for a notification or the timeout
let published =
client.?;
assert!;
Benchmarking
Use existing benchmarking tools like criterion with Client::timings.
Timings::server is time spent in the language server. request and response are worth a look too since large messages take time
criterion_group!;
criterion_main!;
limitations
- server to client requests get a canned response. They could be scriptable and assertable
- stdout is supported but not node ipc or tcp