Skip to main content

Crate aether_lspd

Crate aether_lspd 

Source
Expand description

§aether-lspd

An LSP daemon that manages language server processes and shares them across multiple Aether agents. Communicates over Unix domain sockets.

§Table of Contents

§Quick start

Connect to a workspace, query hover info, and disconnect:

use aether_lspd::{LspClient, LanguageId, path_to_uri};
use std::path::Path;

#[tokio::main]
async fn main() -> aether_lspd::ClientResult<()> {
    let client = LspClient::connect(
        Path::new("/home/user/my-project"),
        LanguageId::Rust,
    ).await?;

    let uri = path_to_uri(Path::new("/home/user/my-project/src/main.rs")).unwrap();
    let hover = client.hover(uri, 10, 5).await?;

    client.disconnect().await?;
    Ok(())
}

The client auto-spawns a daemon process if one isn’t already running. Multiple clients can share the same daemon for a given workspace and language.

§Documentation

Full API documentation is available on docs.rs.

Key entry points:

  • LspClient – connect to a daemon and make LSP requests
  • run_lspd – run the daemon that manages language servers
  • LanguageId – supported languages and their LSP server configurations

§Key Types

  • LspClient – Client for connecting to a running daemon. Supports go-to-definition, references, hover, diagnostics, rename, and more. Requests on one client run concurrently.
  • LspdArgs – Daemon settings: socket path, idle timeout and per-request timeout. The client-daemon protocol is private and versioned through the socket name.
  • LanguageId – Supported language identifiers with associated LSP server configurations.

§Feature Flags

FeatureDescription
testingTest utilities for integration tests

§License

MIT

Re-exports§

pub use error::DaemonError;
pub use error::DaemonResult;
pub use language_catalog::LANGUAGES;
pub use language_catalog::LanguageId;
pub use language_catalog::LanguageMetadata;
pub use language_catalog::ServerSpec;
pub use language_catalog::detect_project_languages;
pub use uri::UriError;
pub use uri::path_to_uri;
pub use uri::uri_to_path;

Modules§

error
language_catalog
testing
Scaffolds temporary projects and in-process daemons for integration testing against language servers.
uri
URI↔path conversion utilities for LSP file URIs.

Structs§

LspClient
Client for connecting to a running aether-lspd daemon over a Unix domain socket. Requests from one client run concurrently, so a slow diagnostics query never holds up a hover.
LspdArgs

Enums§

ClientError
Errors that can occur when using LspClient.
LspdRunError

Constants§

LSP_REQUEST_TIMED_OUT
Error code for a request that exceeded the daemon’s per-request timeout. The daemon kills and replaces the language server when this fires.

Functions§

run_lspd
socket_path
Generate a deterministic Unix socket path for a workspace and language.

Type Aliases§

ClientResult