/**
 * ServerRegistry - Registry for LSP server configurations
 *
 * Manages both built-in and custom LSP server configurations.
 *
 * @see spec.md US-004: Custom LSP Registration
 * @satisfies AC-US4-01
 */
/**
 * Built-in server configurations
 */
const BUILT_IN_SERVERS = {
    typescript: {
        command: 'typescript-language-server',
        args: ['--stdio'],
        filePatterns: ['*.ts', '*.tsx', '*.js', '*.jsx'],
        languageId: 'typescript',
    },
    csharp: {
        command: 'csharp-ls',
        args: [],
        filePatterns: ['*.cs'],
        languageId: 'csharp',
    },
    go: {
        command: 'gopls',
        args: ['serve'],
        filePatterns: ['*.go'],
        languageId: 'go',
    },
    python: {
        command: 'pyright-langserver',
        args: ['--stdio'],
        filePatterns: ['*.py'],
        languageId: 'python',
    },
    rust: {
        command: 'rust-analyzer',
        args: [],
        filePatterns: ['*.rs'],
        languageId: 'rust',
    },
};
/**
 * Registry for managing LSP server configurations
 */
export class ServerRegistry {
    constructor(config) {
        this.servers = new Map();
        this.customServers = new Set();
        // Load built-in servers first
        for (const [name, serverConfig] of Object.entries(BUILT_IN_SERVERS)) {
            this.servers.set(name, { ...serverConfig });
        }
        // Merge/override with custom servers
        if (config.servers) {
            for (const [name, serverConfig] of Object.entries(config.servers)) {
                this.servers.set(name, serverConfig);
                this.customServers.add(name);
            }
        }
    }
    /**
     * Get server configuration by name
     *
     * @param name - Server name (e.g., 'typescript', 'myLang')
     * @returns Server configuration or undefined
     */
    get(name) {
        return this.servers.get(name);
    }
    /**
     * List all available server names
     *
     * @returns Array of server names
     */
    listAll() {
        return Array.from(this.servers.keys());
    }
    /**
     * List only custom server names
     *
     * @returns Array of custom server names
     */
    listCustom() {
        return Array.from(this.customServers);
    }
    /**
     * Check if a server is custom (not built-in)
     *
     * @param name - Server name
     * @returns True if the server is custom
     */
    isCustom(name) {
        return this.customServers.has(name);
    }
}
//# sourceMappingURL=server-registry.js.map