-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()

local lspconfig = require "lspconfig"

-- EXAMPLE
local servers = {
	"arduino_language_server",
	"ccls", --C/C++
	-- "csharp_ls",
	"cssls", --CSS
	"css_variables",
  "dartls", --Dart
  "gopls",
	"html",
  "marksman",
  -- "pylsp",
  "rust_analyzer",
	"svelte",
  "sqlls", --SQL
	"ts_ls" --TypeScript  
}

lspconfig.omnisharp.setup {
    cmd = { "dotnet", "/home/greg/.local/share/nvim/mason/packages/omnisharp/libexec/OmniSharp.dll"},
}

-- lspconfig.rust_analyzer.setup {
--   settings = {
--     ['rust-analyzer'] = {
--       diagnostics = {
--         enabled = false
--       }
--     }
--   }
-- }

lspconfig.pylsp.setup {
  cmd = { "/home/greg/.venv312/bin/pylsp" },
  settings = {
    pylsp = {
      plugins = {
        black = { enabled = true },
        -- pylint = { enabled = true, executable = "pylint", args = { "--jobs=4" } },
        pycodestyle = { enabled = false },
        pylsp_mypy = { enabled = true },
      }
    }
  }
}

local nvlsp = require "nvchad.configs.lspconfig"

-- lsps with default config
for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    on_attach = nvlsp.on_attach,
    on_init = nvlsp.on_init,
    capabilities = nvlsp.capabilities,
  }
end

-- configuring single server, example: typescript
-- lspconfig.tsserver.setup {
--   on_attach = nvlsp.on_attach,
--   on_init = nvlsp.on_init,
--   capabilities = nvlsp.capabilities,
-- }
