Expand description
Scaffolds temporary projects and in-process daemons for integration testing against language servers.
Enable with the testing feature flag:
aether-lspd = { version = "...", features = ["testing"] }§Projects
Projects are TestWorkspaces, so they share its file, write, path, and path_string helpers and are cleaned up when dropped.
cargo_project(name)– A Cargo project withCargo.tomlandsrc/main.rs.node_project(name)– A Node.js/TypeScript project withpackage.json,tsconfig.json,src/index.ts, and TypeScript 7 installed locally withnpm install.file_uri(path)– The LSPfile://URI for a path.
§Daemons
TestDaemon– An in-process daemon with deterministic shutdown. Its socket accepts connections as soon asspawnreturns.TestDaemon::builderoverrides the request, diagnostics and settle timeouts.configure_fake_server– Points a language at the shared fake language server. The fake server holds diagnostics for files containing// hold-diagnosticsuntil it receives afake/releaseDiagnosticsrequest, and reports itself as loading while the workspace root holds a.fake-loadingfile, until afake/finishLoadingrequest.
§Example
use aether_lspd::testing::{cargo_project, file_uri};
let project = cargo_project("my-test");
project.write("src/lib.rs", "pub fn hello() -> &'static str { \"hi\" }");
let uri = file_uri(&project.path("src/lib.rs"));Structs§
- Test
Daemon - An in-process daemon with explicit configuration and deterministic shutdown.
- Test
Daemon Builder - Configures a
TestDaemonbefore it starts. Unset timeouts match the production daemon. - Test
Gate - Test
Workspace
Enums§
Functions§
- cargo_
project - configure_
fake_ ⚠server - Configure one language to use the shared fake Python server in the current test process.
- file_
uri - node_
project