Skip to main content

harness_lsp/
lib.rs

1//! LSP tool — Rust port of `@agent-sh/harness-lsp`.
2//!
3//! Conforms to `agent-knowledge/design/lsp.md`. Same contract as the TS
4//! package: 1-indexed position boundary, discriminated-union result,
5//! hover/definition/references/documentSymbol/workspaceSymbol/implementation
6//! operations, `server_starting` exponential retry hint, stub client
7//! for tests + real spawn client for production.
8
9mod constants;
10mod fence;
11mod format;
12mod manifest;
13mod run;
14mod schema;
15mod spawn_client;
16mod stub_client;
17mod types;
18
19pub use constants::*;
20pub use format::{
21    cap_hover_markdown, cap_preview, format_document_symbols, format_hover, format_locations,
22    format_no_results, format_server_starting, format_workspace_symbols, no_results_hint,
23};
24pub use manifest::{find_lsp_root, load_manifest, profile_for_path};
25pub use run::lsp;
26pub use schema::{
27    safe_parse_lsp_params, validate_per_op, LspParams, LspParseError, LspValidateResult,
28    LSP_TOOL_DESCRIPTION, LSP_TOOL_NAME,
29};
30pub use spawn_client::SpawnLspClient;
31pub use stub_client::{StubBehavior, StubLspClient, StubResponses};
32pub use types::{
33    LspClient, LspDefinitionOk, LspDocumentSymbolOk, LspError, LspHoverOk, LspHoverResult,
34    LspImplementationOk, LspLocation, LspManifest, LspNoResults, LspOperation,
35    LspPermissionPolicy, LspReferencesOk, LspResult, LspServerProfile, LspServerStarting,
36    LspSessionConfig, LspSymbolInfo, LspWorkspaceSymbolOk, Position1, ServerHandle, ServerState,
37};