/** * Copyright (c) 2026 Ivan Iraci * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import { type ServerCapabilities, type InitializeResult, type TextDocumentItem, type TextDocumentContentChangeEvent, type Position, type Location, type LocationLink, type Hover, type SignatureHelp, type DocumentSymbol, type SymbolInformation, type WorkspaceSymbol, type CompletionList, type CompletionItem, type WorkspaceEdit, type Diagnostic, type Range, type CodeAction, type Command, type CallHierarchyItem, type CallHierarchyIncomingCall, type CallHierarchyOutgoingCall, type TypeHierarchyItem, type TextEdit, type FormattingOptions, type DocumentHighlight, type InlayHint, type SelectionRange, type FoldingRange } from 'vscode-languageserver-protocol'; import type { LSPClient as ILSPClient, LSPServerConfig } from '../types.js'; type DiagnosticsHandler = (uri: string, diagnostics: Diagnostic[]) => void; type ErrorHandler = (error: Error) => void; type ExitHandler = (code: number | null) => void; /** * LSP Client implementation that wraps communication with a language server. */ export declare class LSPClientImpl implements ILSPClient { private readonly config; private readonly timeout; private process; private connection; private _capabilities; private _isInitialized; private _workspaceRoot; private pendingRequests; private diagnosticsCache; private diagnosticsHandlers; private errorHandlers; private exitHandlers; private _nextRequestId; constructor(config: LSPServerConfig, timeout?: number); get capabilities(): ServerCapabilities; get isInitialized(): boolean; get workspaceRoot(): string; get serverId(): string; /** * Initialize the language server. */ initialize(rootUri: string): Promise; /** * Shutdown the language server gracefully. */ shutdown(): Promise; /** * Exit the language server process. */ exit(): void; didOpen(document: TextDocumentItem): void; didChange(uri: string, version: number, changes: TextDocumentContentChangeEvent[]): void; didClose(uri: string): void; definition(uri: string, position: Position): Promise; typeDefinition(uri: string, position: Position): Promise; references(uri: string, position: Position, includeDeclaration: boolean): Promise; implementation(uri: string, position: Position): Promise; hover(uri: string, position: Position): Promise; signatureHelp(uri: string, position: Position): Promise; documentSymbols(uri: string): Promise; workspaceSymbols(query: string): Promise; completion(uri: string, position: Position): Promise; prepareRename(uri: string, position: Position): Promise; rename(uri: string, position: Position, newName: string): Promise; codeActions(uri: string, range: Range, diagnostics: Diagnostic[], kinds?: string[]): Promise<(CodeAction | Command)[] | null>; prepareCallHierarchy(uri: string, position: Position): Promise; callHierarchyIncomingCalls(item: CallHierarchyItem): Promise; callHierarchyOutgoingCalls(item: CallHierarchyItem): Promise; prepareTypeHierarchy(uri: string, position: Position): Promise; typeHierarchySupertypes(item: TypeHierarchyItem): Promise; typeHierarchySubtypes(item: TypeHierarchyItem): Promise; formatDocument(uri: string, options: FormattingOptions): Promise; documentHighlight(uri: string, position: Position): Promise; inlayHints(uri: string, range: Range): Promise; selectionRange(uri: string, positions: Position[]): Promise; foldingRanges(uri: string): Promise; cancelRequest(id: number | string): void; getCachedDiagnostics(uri: string): Diagnostic[]; onDiagnostics(handler: DiagnosticsHandler): void; onError(handler: ErrorHandler): void; onExit(handler: ExitHandler): void; private setupNotificationHandlers; private sendRequest; private ensureConnection; private ensureCapability; private notifyError; private notifyExit; private cleanup; private getInstallCommand; /** * Get the process ID of the language server. */ getPid(): number | null; } /** * Create a new LSP client instance. */ export declare function createLSPClient(config: LSPServerConfig, timeout?: number): ILSPClient; export {}; //# sourceMappingURL=lsp-client.d.ts.map