/** * LSP Manager * * Manages multiple LSP clients and provides unified interface for semantic analysis. * Automatically detects and initializes appropriate language servers. * * For TypeScript projects, uses TsServerClient (direct tsserver protocol) instead * of typescript-language-server, which has issues with large projects (>500 files). * * @module core/lsp/lsp-manager */ import { LSPDefinitionResult, LSPReferencesResult, LSPHoverResult, LSPDocumentSymbolsResult, LSPWorkspaceSymbolsResult } from './lsp-client.js'; import { type LspConfig } from './config/lsp-config.js'; export interface LSPManagerOptions { projectRoot: string; enabledLanguages?: string[]; /** LSP configuration (from .specweave/config.json) */ lspConfig?: LspConfig; } /** * Manages LSP clients for multiple languages */ export declare class LSPManager { private clients; private projectRoot; private initialized; /** Timeout resolver for per-language timeouts */ private readonly timeoutResolver; constructor(options: LSPManagerOptions); /** * Initialize all available LSP servers * For TypeScript, uses TsServerClient (direct protocol) instead of * typescript-language-server which has issues with large projects. */ initialize(): Promise; /** * Check if project has TypeScript configuration. * Requires tsconfig.json (or jsconfig.json) - not just package.json, * since package.json alone doesn't indicate a TypeScript project * (Python, Go, etc. projects may have package.json for tooling). */ private hasTypeScriptProject; /** * Get language from LSP command * Supports 10 languages: TypeScript, Python, Go, Rust, Java, C#, Kotlin, Swift, PHP, Ruby */ private getLanguageFromCommand; /** * Get code intelligence client for a file * Maps file extensions to language clients */ private getClientForFile; /** * Check if LSP is available for a file */ isAvailableForFile(filePath: string): boolean; /** * Go to definition using LSP */ goToDefinition(filePath: string, line: number, character: number): Promise; /** * Find references using LSP */ findReferences(filePath: string, line: number, character: number): Promise; /** * Get hover information using LSP */ hover(filePath: string, line: number, character: number): Promise; /** * Get document symbols using LSP */ documentSymbols(filePath: string): Promise; /** * Search workspace symbols using LSP */ workspaceSymbols(query: string): Promise; /** * Find all symbols in a file (legacy method for living docs extraction) */ findSymbols(filePath: string): Promise; /** * Shutdown all LSP clients */ shutdown(): Promise; /** * Get statistics about LSP usage */ getStatistics(): { availableLanguages: string[]; clientCount: number; }; /** * Warm up all LSP clients by triggering workspace indexing * This should be called on session start to prevent timeout on first query * v1.0.197: Added for session-start warm-up integration * * @param entryFiles Optional list of key project files to pre-open */ warmup(entryFiles?: string[]): Promise<{ success: boolean; warmedUp: string[]; failed: string[]; }>; /** * Check if all clients are warmed up */ isWarmedUp(): boolean; } /** * Get or create global LSP manager */ export declare function getGlobalLSPManager(projectRoot?: string): LSPManager; /** * Shutdown global LSP manager */ export declare function shutdownGlobalLSPManager(): Promise; //# sourceMappingURL=lsp-manager.d.ts.map