import { type InitializeResult } from "vscode-languageserver/node"; import type { CompletionItem, CompletionParams, Hover, HoverParams } from "vscode-languageserver"; import { TextDocument } from "vscode-languageserver-textdocument"; /** * The subset of a `Connection` the handlers touch. Narrowed to an interface so * tests can drive the wiring with a fake instead of a live stdio transport. */ export interface DiagnosticsConnection { onInitialize(handler: () => InitializeResult): void; sendDiagnostics(params: { uri: string; diagnostics: unknown[]; }): void; onCompletion(handler: (params: CompletionParams) => CompletionItem[]): void; onHover(handler: (params: HoverParams) => Hover | null): void; } /** * The subset of a `TextDocuments` manager the handlers subscribe to. */ export interface DocumentEvents { onDidChangeContent(handler: (event: { document: TextDocument; }) => void): void; onDidClose(handler: (event: { document: TextDocument; }) => void): void; get(uri: string): TextDocument | undefined; } /** * Wire language-server behavior onto a connection + document manager. Pure of * any transport, so a unit test can pass fakes, capture the registered * callbacks, and assert what gets published — no real process required. */ export declare function registerHandlers(connection: DiagnosticsConnection, documents: DocumentEvents): void; /** * Boot the language server over stdio. Called by the `doc-detective lsp` * subcommand. */ export declare function startServer(): void; //# sourceMappingURL=server.d.ts.map