/** * Built-in LSP Server Definitions * * Defines how to locate language servers and build command strings for supported languages. * Server definitions are pure data — they don't spawn processes themselves. * The LSPClient uses a SandboxProcessManager to spawn from these command strings. */ import type { LSPConfig, LSPServerDef } from './types.js'; /** * Walk up from a starting directory looking for any of the given markers. * Returns the first directory that contains a marker, or null. */ export declare function walkUp(startDir: string, markers: string[]): string | null; /** * Async version of walkUp that uses a filesystem's exists() method. * Works with any filesystem (local, S3, GCS, composite) that implements exists(). */ export declare function walkUpAsync(startDir: string, markers: string[], fs: { exists(path: string): Promise; }): Promise; /** * Find a project root by walking up from a starting directory. * Uses default markers (tsconfig.json, package.json, go.mod, etc.). * Used by Workspace to resolve the default LSP root at construction time. */ export declare function findProjectRoot(startDir: string): string | null; /** * Async version of findProjectRoot that uses a filesystem's exists() method. * Works with any filesystem (local, S3, GCS, composite) that implements exists(). */ export declare function findProjectRootAsync(startDir: string, fs: { exists(path: string): Promise; }): Promise; /** * Build a set of server definitions that incorporate LSP config overrides. * * Resolution order per server: * 1. `config.binaryOverrides[id]` — explicit binary command override * 2. Project `node_modules/.bin/` binary * 3. `process.cwd()` `node_modules/.bin/` binary * 4. `config.searchPaths` `node_modules/.bin/` binary lookup * 5. Global PATH lookup (system-installed binaries) * 6. `config.packageRunner` — package runner fallback (off by default) * * `config.searchPaths` also extends TypeScript module resolution * (used to locate typescript/lib/tsserver.js when it lives outside the project). */ export declare function buildServerDefs(config?: LSPConfig): Record; /** * Built-in LSP server definitions with no config overrides. * Use `buildServerDefs(config)` when you need binaryOverrides, searchPaths, or packageRunner. */ export declare const BUILTIN_SERVERS: Record; /** * Get all server definitions that can handle the given file. * Filters by language ID match only — the manager resolves the root and checks command availability. * Pass `defs` to use config-aware server definitions from `buildServerDefs()`. */ export declare function getServersForFile(filePath: string, disabledServers?: string[], defs?: Record): LSPServerDef[]; //# sourceMappingURL=servers.d.ts.map