require("nvchad.configs.lspconfig").defaults()

local servers = {
    "arduino_language_server",
    "ccls",
    "cssls",
    "css_variables",
    "dartls",
    "gopls",
    "html",
    "marksman",
    "rust_analyzer",
    "svelte",
    "sqls",
    "ts_ls"
}

local nvlsp = require "nvchad.configs.lspconfig"

vim.lsp.config.omnisharp = {
    cmd = { "dotnet", "/home/greg/.local/share/nvim/mason/packages/omnisharp/libexec/OmniSharp.dll" },
    on_attach = nvlsp.on_attach,
    on_init = nvlsp.on_init,
    capabilities = nvlsp.capabilities,
}

vim.lsp.config.pylsp = {
    cmd = { "/home/greg/.venv312/bin/pylsp" },
    settings = {
        pylsp = {
            plugins = {
                black = { enabled = true },
                pycodestyle = { enabled = false },
                pylsp_mypy = { enabled = true },
            }
        }
    },
    on_attach = nvlsp.on_attach,
    on_init = nvlsp.on_init,
    capabilities = nvlsp.capabilities,
}

for _, lsp in ipairs(servers) do
    vim.lsp.config[lsp] = {
        on_attach = nvlsp.on_attach,
        on_init = nvlsp.on_init,
        capabilities = nvlsp.capabilities,
    }
end

for _, lsp in ipairs(servers) do
    vim.lsp.enable(lsp)
end
vim.lsp.enable('omnisharp')
vim.lsp.enable('pylsp')
