local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities

local lspconfig = require "lspconfig"
local lspsettings = require "custom.configs.lspsettings"

-- if you just want default config for the servers then put them in a table
local servers = {
  "html",
  "cssls",
  "tsserver",
  "clangd",
  "pyright",
  "bashls",
  "cmake",
  "yamlls",
  "texlab",
}

for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    on_attach = on_attach,
    capabilities = capabilities,
  }
end

local server_with_settings = {
  -- "textlsp",
  "ltex",
  "rust_analyzer",
}

for _, lsp in ipairs(server_with_settings) do
  lspconfig[lsp].setup(lspsettings[lsp])
end
