/* * LspServerConfig.h - per-language LSP server configuration */ #ifndef KTE_LSP_SERVER_CONFIG_H #define KTE_LSP_SERVER_CONFIG_H #include #include #include namespace kte::lsp { enum class LspSyncMode { None = 0, Full = 1, Incremental = 2, }; struct LspServerConfig { std::string command; // executable name/path std::vector args; // CLI args std::vector filePatterns; // e.g. {"*.rs"} std::string rootPatterns; // e.g. "Cargo.toml" LspSyncMode preferredSyncMode = LspSyncMode::Incremental; bool autostart = true; std::unordered_map initializationOptions; // placeholder std::unordered_map settings; // placeholder }; // Provide a small set of defaults; callers may ignore inline std::vector GetDefaultServerConfigs() { return std::vector{ LspServerConfig{ .command = "rust-analyzer", .args = {}, .filePatterns = {"*.rs"}, .rootPatterns = "Cargo.toml" }, LspServerConfig{ .command = "clangd", .args = {"--background-index"}, .filePatterns = {"*.c", "*.cc", "*.cpp", "*.h", "*.hpp"}, .rootPatterns = "compile_commands.json" }, LspServerConfig{.command = "gopls", .args = {}, .filePatterns = {"*.go"}, .rootPatterns = "go.mod"}, }; } } // namespace kte::lsp #endif // KTE_LSP_SERVER_CONFIG_H