import type { LexiconPlugin } from "../../lexicon.js"; /** * JSON-RPC message types */ interface JsonRpcRequest { jsonrpc: "2.0"; id: string | number; method: string; params?: Record; } interface JsonRpcResponse { jsonrpc: "2.0"; id: string | number; result?: unknown; error?: { code: number; message: string; data?: unknown; }; } interface JsonRpcNotification { jsonrpc: "2.0"; method: string; params?: Record; } /** * stdio LSP server using Content-Length framing. * Delegates completions, hover, and code actions to lexicon plugins. */ export declare class LspServer { private plugins; openDocuments: Map; private buffer; /** Captured notifications for testing — only populated when captureNotifications is true */ sentNotifications: Array<{ method: string; params: Record; }>; private captureNotifications; constructor(plugins: LexiconPlugin[], options?: { captureNotifications?: boolean; }); /** * Start reading from stdin with Content-Length framing */ start(): Promise; /** * Process the incoming buffer, extracting complete messages */ private processBuffer; /** * Send a request and return the response directly (for testing). */ sendRequest(method: string, params?: Record): Promise; /** * Handle a JSON-RPC request (has id, expects response) */ handleRequest(request: JsonRpcRequest): Promise; /** * Handle a JSON-RPC notification (no id, no response). * Public to allow direct testing without stdio. */ handleNotification(notification: JsonRpcNotification): void; /** * Dispatch request to appropriate handler */ private dispatch; /** * Handle initialize request */ private handleInitialize; /** * Handle textDocument/completion */ private handleCompletion; /** * Handle textDocument/hover */ private handleHover; /** * Handle textDocument/codeAction */ private handleCodeAction; /** * Handle textDocument/diagnostic (pull model) */ private handleDiagnostic; /** * Publish diagnostics for a document (push model) */ private publishDiagnostics; /** * Run lint engine and convert to LSP diagnostics */ private computeDiagnostics; /** * Send a JSON-RPC response with Content-Length framing */ private sendResponse; /** * Send a JSON-RPC notification with Content-Length framing */ private sendNotification; } export {}; //# sourceMappingURL=server.d.ts.map