local cmp_cap = require("config.cmp").capabilities local servers = { "gopls", "phpactor", "ols", "zls", "tsgo", "eslint", "yamlls", "vimls", "ruff", "basedpyright", "denols", "lua_ls", "qmlls", "nil_ls", "arduino_language_server", "cmake", "clangd", "hyprls", "nginx_language_server", "docker_compose_language_service", "dockerls", "html", "cssls", "tailwindcss", "jdtls", "powershell_es", "rust_analyzer", "digestif", } for _, server in ipairs(servers) do vim.lsp.config(server, { capabilities = cmp_cap, }) vim.lsp.enable(server) end vim.lsp.config("tsgo", { cmd = function(dispatchers, config) local bin = "tsc" if (config or {}).root_dir then local local_bin = vim.fs.joinpath(config.root_dir, "node_modules/.bin", bin) if vim.fn.executable(local_bin) == 1 then bin = local_bin end end return vim.lsp.rpc.start({ bin, "--lsp", "--stdio" }, dispatchers) end, }) vim.lsp.config("digestif", { cmd = { vim.fn.expand "~/.luarocks/bin/digestif" }, }) vim.lsp.config("powershell_es", { capabilities = cmp_cap, bundle_path = "/opt/powershell-editor-services", }) vim.lsp.config("rust_analyzer", { capabilities = cmp_cap, settings = { ["rust-analyzer"] = { check = { command = "clippy", trigger = "onType", }, }, }, }) vim.lsp.config("eslint", { settings = { experimental = { useFlatConfig = true, }, }, }) local arduino_cap = vim.tbl_deep_extend("force", cmp_cap, { textDocument = { semanticTokens = vim.NIL }, workspace = { semanticTokens = vim.NIL }, }) vim.lsp.config("arduino_language_server", { capabilities = arduino_cap, })